Repository navigation
Update dusk-bls12_381 to 0.16 and dusk-jubjub to 0.16 - #1012
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The compatibility changes are focused, correctly preserve prior behavior, and are covered by the reported validation suites.
0 open findings
What changed in this PR
Updates core cryptographic dependencies to their published 0.16 releases and adapts private scalar-limb access.
Changes:
- Upgrades
dusk-bls12_381anddusk-jubjub. - Replaces direct scalar limb access with supported APIs.
- Documents the dependency update.
| File | Description |
|---|---|
Cargo.toml |
Updates dependency versions. |
src/composer.rs |
Constructs negative one through const arithmetic. |
tests/ecc.rs |
Uses internal_repr() for scalar limbs. |
CHANGELOG.md |
Records the upgrade and issue reference. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1012 +/- ##
==========================================
- Coverage 92.31% 92.27% -0.04%
==========================================
Files 80 81 +1
Lines 8924 8886 -38
==========================================
- Hits 8238 8200 -38
Misses 686 686
... and 12 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
moCello
left a comment
There was a problem hiding this comment.
APPROVE — The bump is complete and the new -1 constant has the same limbs as the old literal, so nothing gates the merge.
- Agreed with herr-seppia's request for a comparison test. The new constant equals the old literal limb for limb, and a test can pin that: compare
*BlsScalar::one().neg().internal_repr()with the old limb array. It does not gate the merge, becauseMINUS_ONEonly selects a fast path. - Optional:
CommitKey::commitcheckspolynomial.degree(), but since bls 0.15msm_variable_basepanics on slice length. A polynomial with trailing zeros andlen() > powers_of_g.len()passes the guard and panics. Today only the trimming insrc/fft/polynomial.rsprevents that, not the degree check. Callingtry_msm_variable_baseand mappingInsufficientBasestoError::PolynomialDegreeTooLargemakes the guard cover the slice the MSM consumes. - Optional: since dusk-jubjub 0.16,
JubJubExtended::is_on_curvereturns false onZ = 0without projecting. Two comments now give a false reason for theZcheck, because they describe the internals of a dependency. Reduce the doc onreject_degenerate_z(src/composer/point.rs) to what this code needs:Z = 0is no point, so reject it before projecting to affine. Incomponent_mul_generator(src/composer/fixed_base.rs), delete the "Check Z first" comment.
5642c7e to
8fc1c00
Compare
|
Force-pushed
|
moCello
left a comment
There was a problem hiding this comment.
APPROVE — The new test pins the old limbs of MINUS_ONE, commit now guards the slice the MSM consumes, and the two named comments no longer describe dusk-jubjub internals.
- Point 3 of my review: two test comments in
tests/ecc.rsstill say thatis_on_curveprojects and would panic onZ = 0. In the doc onzero_z_point, keep only what the test needs: the point hasZ = 0and the honest generator's numerators, so only theZguard separates it from a valid point. Inappend_constant_point_separates_its_rejection_branches, reduce the comment to "Degenerate representation: refused before the membership check." - The pull request description is stale. It says the stricter
msm_variable_base"cannot trigger" because commits are degree-checked. Update it to name the length guard inCommitKey::commit.
BlsScalar limbs are crate-private in 0.16, so build the -1 constant with const arithmetic, which yields the same limbs, and read limbs in the ECC test through internal_repr. Resolves #1011
8fc1c00 to
a634f1f
Compare
|
Force-pushed |
Resolves #1011
dusk-bls12_381anddusk-jubjubto the published 0.16 releases.BlsScalarlimbs are crate-private in 0.16: build the-1constant inComposerwithBlsScalar::one().neg(), which evaluates at compile time to the same limbs, and read limbs in the ECC test throughinternal_repr(). A test pinsMINUS_ONEto its previous limbs.msm_variable_basepanics on fewer bases than scalars, and the degree check inCommitKey::commitskips leading zero coefficients.commitnow callstry_msm_variable_baseand returnsError::PolynomialDegreeTooLargewhen a polynomial has more coefficients than the key has powers. The verifier builds its points and scalars in pairs.is_on_curverejectsZ = 0without projecting; the comments that said otherwise are corrected.make test(37 groups),make clippyandmake no-stdpass locally.