-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expose bls12-381 G1 curve commitments ( PROOF-667 ) #9
feat: expose bls12-381 G1 curve commitments ( PROOF-667 ) #9
Conversation
* add test for compute_bls12_381_g1_commitments_with_generators
* remove conversion to projective elements in compute_bls12_381_g1_commitments_with_generators
/// | ||
///# Example 1 - Pass generators to Commitment Computation | ||
///```no_run | ||
#[doc = include_str!("../../examples/pass_generators_to_commitment.rs")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you referencing these examples? Aren't those for curve-25519?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they do refer to curve-25519. I am referencing those for two reasons.
- The
doc
tag doesn't seem to be working, see PROOF-708. I want to get that fixed before I write the documentation. I'm not positive how to test formatting without understanding how thedoc
tag should appear. For example, I don't know if I can use the samemd
file to document both functions, or need a separatemd
file? - If I remove the
doc
tags,cargo
throws an error:error: missing documentation for a function
.
Here is how the doc
tag appears now when hovering over a function.
And blitzar
doesn't have a Documents section on crates.io.
I was hoping to avoid scope creep on this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need the tags as a placeholder, please indicate so with a comment so that someone looking at the code understand why they're there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea. Added.
🎉 This PR is included in version 1.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Rationale for this change
In order to expose commitment computation with bls12-381 elements,
blitzar-rs
needs to implement a method in the commitments module. This PR does that work.Notes for follow up work.
doc
tag is not behaving as expected. A bug has been entered to investigate. See PROOF-708.compute_bls12_381_g1_commitments_with_generators
. See PROOF-710.What changes are included in this PR?
compute_bls12_381_g1_commitments_with_generators
is added to the commitments module.blitzar-sys
version is bumped to1.3.3
.Are these changes tested?
Yes.
Note, scalar elements for the bls12-381 curve are in Montgomery form. A test similar to
sending_generators_and_scalars_to_gpu_produces_correct_commitment_results
was not written at this time. The.into()
method needs implement a method to convert[Fp<MontBackend<T, N>, N>]
toBigInt<N>
in order to pass the correct values to theSequence
parameter. The Sequence module does have an optional BigIntFrom
implementation.