-
Notifications
You must be signed in to change notification settings - Fork 112
[cryptography/bls12381] Test Partial Signature Derivation #1082
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
Conversation
| match namespace { | ||
| Some(namespace) => hm.map(V::MESSAGE, &union_unique(namespace, msg)), | ||
| None => hm.map(V::MESSAGE, msg), | ||
| let hm = match namespace { |
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.
Switching to hash_message fixes an erroneous linting 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.
Pull Request Overview
Adds a new test for deriving missing BLS partial signatures and refactors message hashing to use hash_message.
- Replaces manual
Signature::zero+mapcalls withhash_messagein three loops. - Introduces
threshold_derive_missing_partialshelper andtest_threshold_signature_derive_partialstest.
Comments suppressed due to low confidence (2)
cryptography/src/bls12381/primitives/ops.rs:2367
- [nitpick] The parameter names
eval_at_xandi_xare ambiguous. Consider renaming them totarget_indexandbasis_indexrespectively to clarify their roles in the Lagrange coefficient calculation.
fn lagrange_coeff(eval_at_x: u32, i_x: u32, x_coords: &[u32]) -> Scalar {
cryptography/src/bls12381/primitives/ops.rs:2366
- [nitpick] Consider expanding this doc comment with the mathematical formula and explaining why
eval_at_x + 1is used before converting toScalar.
// Helper to compute the Lagrange basis polynomial l_i(x) evaluated at a specific point `eval_at_x`.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #1082 +/- ##
==========================================
+ Coverage 91.10% 91.11% +0.01%
==========================================
Files 191 191
Lines 54839 54919 +80
==========================================
+ Hits 49960 50040 +80
Misses 4879 4879
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This test derives
n-tpartial signatures fromtprovided partial signatures (i.e. it tests "generic" signature recovery).Justification
While we never perform this operation in practice (at least for now), it [1] serves as a reminder that using partial signatures for accountability (when
>= texist) is unsound and [2] serves as a conformance test that our share derivation, partial signing, and msm logic is consistent.