Skip to content

test(crypto): update wycheproof to 0.7 and treat Ed25519 test case 151 as valid under ZIP215 - #12185

Merged
basvandijk merged 1 commit into
masterfrom
bas/bump-wycheproof-0.7
Nov 19, 2026
Merged

basvandijk merged 1 commit into
masterfrom
bas/bump-wycheproof-0.7

Conversation

@basvandijk

@basvandijk basvandijk commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

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 (flag InvalidEncoding).

ic-ed25519's verify_signature follows 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 by verification_follows_zip215) contain this exact R 27 times. rs/crypto/internal/crypto_lib/basic_sig/ed25519 verifies 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

  • wycheproof 0.6 → 0.7 in Cargo.toml and bazel/rust.MODULE.bazel. In both lock sets only wycheproof moves, from 0.6.0 to 0.7.0.
  • packages/ic-ed25519/tests/tests.rs and rs/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:

  • Tests: bazel test of all 18 test targets that depend on @crate_index//:wycheproof passes. With wycheproof 0.7 and the old tests, cargo test failed only the two Ed25519 Wycheproof tests.
  • Locks: in the dev container, cargo update --workspace reports "Locking 0 packages". A second ./bin/bazel-pin.sh reports "Nothing to repin.". bazel mod deps leaves MODULE.bazel.lock unchanged.
  • Lint: bazel run //bazel:buildifier.check and ./ci/scripts/rust-lint.sh pass.

This PR carries the CI_ALL_BAZEL_TARGETS label.

🤖 Generated with Claude Code

@basvandijk
basvandijk added this pull request to stack #12179 November 19, 2026 11:26
@basvandijk basvandijk changed the title bas/bump wycheproof 0.7 test(crypto): update wycheproof to 0.7 and treat Ed25519 test case 151 as valid under ZIP215 Nov 19, 2026
@basvandijk basvandijk added the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Nov 19, 2026
@github-actions github-actions Bot added the test label Nov 19, 2026
@basvandijk
basvandijk requested a balanced review from Copilot November 19, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@basvandijk
basvandijk marked this pull request as ready for review November 19, 2026 11:46
@basvandijk
basvandijk requested review from a team as code owners November 19, 2026 11:46
@zeropath-ai

zeropath-ai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 1c888df.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► wycheproof (Cargo.lock references)
Description: Bump wycheproof from 0.6.0 to 0.7.0 across multiple lockfiles and manifests to align versions
Enhancement ► Cargo.toml
Description: Update wycheproof dependency version from 0.6 to 0.7
Enhancement ► bazel/rust.MODULE.bazel
Description: Update wycheproof version constraint from ^0.6 to ^0.7
Enhancement ► Cargo.Bazel.json.lock
Description: Update wycheproof checksum and version references to 0.7.0; adjust dependent crates (serde_derive)
Enhancement ► Cargo.Bazel.toml.lock
Description: Update wycheproof to 0.7.0; update checksum and dependencies to include serde_derive
Enhancement ► Cargo.lock
Description: Update wycheproof to 0.7.0; update checksum and dependencies to include serde_derive
Enhancement ► env changes not present

Base automatically changed from bas/relax-cc-and-update-sys-crates to master November 19, 2026 12:01
@basvandijk
basvandijk requested review from a team as code owners November 19, 2026 12:01
…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>
@basvandijk
basvandijk force-pushed the bas/bump-wycheproof-0.7 branch from a118cf9 to 1c888df Compare November 19, 2026 12:01

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. 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

@basvandijk
basvandijk added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit 4b4fc5d Nov 19, 2026
43 checks passed
@basvandijk
basvandijk deleted the bas/bump-wycheproof-0.7 branch November 19, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants