Repository navigation
test(crypto): update wycheproof to 0.7 and treat Ed25519 test case 151 as valid under ZIP215 - #12185
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the test-only Wycheproof upgrade and accompanying Ed25519 test updates.
No open issues 🎉
What changed in this PR
Updates the test-only Wycheproof dependency to 0.7 across Cargo and Bazel, completing the upgrade deferred from the earlier dependency refresh. The Ed25519 tests explicitly require acceptance of case 151 under ZIP215 without changing production verification behavior.
Changes:
- Upgrade Wycheproof from 0.6 to 0.7 and synchronize both build systems’ lockfiles.
- Assert that Ed25519 case 151 verifies, rather than skipping it.
- Include test-case IDs in verification assertion failures.
| File | Description |
|---|---|
rs/crypto/internal/crypto_lib/basic_sig/ed25519/src/api/tests.rs |
Expect ZIP215 acceptance of case 151 and identify failing cases. |
packages/ic-ed25519/tests/tests.rs |
Apply the same ZIP215 expectation and assertion diagnostics. |
Cargo.toml |
Raise the workspace Wycheproof requirement to 0.7. |
Cargo.lock |
Lock Wycheproof 0.7.0 and its direct serde_derive dependency. |
Cargo.Bazel.toml.lock |
Synchronize Bazel’s dependency lock with the upgrade. |
Cargo.Bazel.json.lock |
Refresh Wycheproof metadata, checksum, and procedural-macro dependency. |
bazel/rust.MODULE.bazel |
Raise Bazel’s Wycheproof requirement to 0.7. |
Review effort: Balanced
|
✅ No security or compliance issues detected. Reviewed everything up to 1c888df. Security OverviewDetected Code Changes
|
…1 as valid under ZIP215 wycheproof 0.7 adds Ed25519 test case 151, whose R encodes y = 1 with the sign bit of x set. RFC 8032 rejects that encoding; ic-ed25519 verifies under ZIP215, which accepts it. Both Ed25519 Wycheproof tests now expect it to verify. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a118cf9 to
1c888df
Compare
There was a problem hiding this comment.
This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):
-
Update
unreleased_changelog.md(if there are behavior changes, even if they are
non-breaking). -
Are there BREAKING changes?
-
Is a data migration needed?
-
Security review?
How to Satisfy This Automatic Review
-
Go to the bottom of the pull request page.
-
Look for where it says this bot is requesting changes.
-
Click the three dots to the right.
-
Select "Dismiss review".
-
In the text entry box, respond to each of the numbered items in the previous
section, declare one of the following:
-
Done.
-
$REASON_WHY_NO_NEED. E.g. for
unreleased_changelog.md, "No
canister behavior changes.", or for item 2, "Existing APIs
behave as before.".
Brief Guide to "Externally Visible" Changes
"Externally visible behavior change" is very often due to some NEW canister API.
Changes to EXISTING APIs are more likely to be "breaking".
If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.
If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.
Reference(s)
For a more comprehensive checklist, see here.
GOVERNANCE_CHECKLIST_REMINDER_DEDUP
No canister changes.
Updates the test-only dependency wycheproof from 0.6 to 0.7 in both builds. 0.7 adds one Ed25519 vector, test case 151, which ic-ed25519 accepts on purpose. The two Ed25519 Wycheproof tests now expect that.
Why test case 151 verifies
Test case 151's R is
0100…0080, which encodes y = 1 with the sign bit of x set. The only point with y = 1 is (0, 1), whose x is 0. So RFC 8032 (Section 5.1.3) says decoding must fail, and Wycheproof marks the vector invalid (flagInvalidEncoding).ic-ed25519's
verify_signaturefollows ZIP215, which does not require canonical encodings of R and A. The crate's own ZIP215 vectors (packages/ic-ed25519/tests/data/zip215.txt, used byverification_follows_zip215) contain this exact R 27 times.rs/crypto/internal/crypto_lib/basic_sig/ed25519verifies through ic-ed25519, so its Wycheproof test fails the same way with 0.7.Both tests now list test case 151 as valid under ZIP215 and assert that it verifies, instead of skipping it. A change to strict RFC 8032 decoding would therefore fail them. Their assertion messages also name the failing test case.
Changes
0.6→0.7inCargo.tomlandbazel/rust.MODULE.bazel. In both lock sets only wycheproof moves, from 0.6.0 to 0.7.0.packages/ic-ed25519/tests/tests.rsandrs/crypto/internal/crypto_lib/basic_sig/ed25519/src/api/tests.rs: the test-case list and the assertion messages.Apart from the new test case, the Ed25519 vector file is the same: 0.6 has 150 vectors, 0.7 has 151, and none of the 150 changed its expected result. All other Wycheproof sets we use pass unchanged with 0.7: ECDSA secp256k1 and secp256r1, RSA PKCS#1 signatures, HKDF and HMAC.
Verification
Run locally on this branch:
bazel testof all 18 test targets that depend on@crate_index//:wycheproofpasses. With wycheproof 0.7 and the old tests,cargo testfailed only the two Ed25519 Wycheproof tests.cargo update --workspacereports "Locking 0 packages". A second./bin/bazel-pin.shreports "Nothing to repin.".bazel mod depsleavesMODULE.bazel.lockunchanged.bazel run //bazel:buildifier.checkand./ci/scripts/rust-lint.shpass.This PR carries the
CI_ALL_BAZEL_TARGETSlabel.🤖 Generated with Claude Code