-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add pairing BLS12 377 #933
Conversation
…s/lambdaworks into add_pairing_bls12_377
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #933 +/- ##
==========================================
+ Coverage 71.62% 72.03% +0.41%
==========================================
Files 149 150 +1
Lines 32560 32909 +349
==========================================
+ Hits 23321 23707 +386
+ Misses 9239 9202 -37 ☔ View full report in Codecov by Sentry. |
math/src/elliptic_curve/short_weierstrass/curves/bls12_377/field_extension.rs
Outdated
Show resolved
Hide resolved
// Pairings over Families of Elliptic Curves" (https://eprint.iacr.org/2020/875.pdf) | ||
|
||
pub fn final_exponentiation(f: &Fp12E) -> Fp12E { | ||
let f_easy_aux = f.conjugate() * f.inv().unwrap(); |
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.
This unwrap should be removed, perhaps pairing error could have another field DivisionByZero
or InvZeroError
? (Maybe converting it from the FieldError
?)
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.
I agree with this.
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.
There are prior validations that ensure that f
won't be zero, so there's no risk of a division by zero or related error occurring here
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.
That is ok, but even though we are sure that Result
will never be Err
, handling the error is always better than using unwrap
.
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.
Makes sense. Changed the final_exponentiation
to handle the error
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.
The PR looks good. Left some comments and suggestions.
math/src/elliptic_curve/short_weierstrass/curves/bls12_377/field_extension.rs
Outdated
Show resolved
Hide resolved
math/src/elliptic_curve/short_weierstrass/curves/bls12_377/pairing.rs
Outdated
Show resolved
Hide resolved
math/src/elliptic_curve/short_weierstrass/curves/bls12_377/field_extension.rs
Show resolved
Hide resolved
This reverts commit 2c3b0c6.
…s/lambdaworks into add_pairing_bls12_377
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.
LGTM
BLS 12-377 pairing
Description
This PR aims to add the pairing for the BLS 12-377 curve.