docknetwork / crypto-wasm-ts

Typescript abstractions over Rust crypto library's WASM wrapper
Apache License 2.0
27 stars 7 forks source link

docs: need updates? #33

Closed lanterno closed 1 month ago

lanterno commented 1 month ago

Hello, I'm trying to follow the documentation to implement the examples. However, the function names seem to have been modified from what I see in the docs.

I managed to still get somewhere by trying my luck by looking for similarly named types.

However right now, I'm trying to create a statement for my proof, but I can't find the Statement.bbsPlusSignature referenced in the docs.

the section where it's referenced:

// Create a BBS+ signature, true indicates that attributes/messages are arbitrary bytes and should be encoded first
const statement1 = Statement.bbsPlusSignature(params, pk, revealedMsgs, true);
const statements = new Statements();
statements.add(statement1);

Can you help me find the right type I should use here?

Finally, thanks for open-sourcing this library, it's really helpful (when I manage to make it work :) )

lovesh commented 1 month ago

Thanks for reporting this and sorry for state of the docs.

Instead of Statement.bbsPlusSignature, use Statement.bbsPlusSignatureProverConstantTime for the prover and Statement.bbsPlusSignatureVerifierConstantTime for the verifier. For more info, see this where the statement for prover and verifier are set based on the scheme being used in testing. These are then used in these 2 utility functions, for prover and verifier. Finally, a test showing the usage.

For a more high level API, see this and corresponding tests.

lanterno commented 1 month ago

Hi @lovesh Thanks for your reply. very helpful. I'll try it today or tomorrow.

I would be happy to do a PR to update the documentation after I finish my experiment with the library. Would that be helpful or not needed?

lovesh commented 1 month ago

Hi @lanterno . The PR would be very helpful and welcome. And let me know of any other questions you have as well.

lanterno commented 1 month ago

Thanks a lot! I'll close this issue for now, and will reopen later if I had other questions.