Skip to content

Wycheproof wave 6: ECDSA secp256k1, Ed448, AES-CMAC - #1925

Merged
paul-hammant merged 1 commit into
mainfrom
crypto/wycheproof-wave6
Sep 6, 2026
Merged

Wycheproof wave 6: ECDSA secp256k1, Ed448, AES-CMAC#1925
paul-hammant merged 1 commit into
mainfrom
crypto/wycheproof-wave6

Conversation

@paul-hammant

Copy link
Copy Markdown
Collaborator

Stacked on #1924 (compiler/warn-malloc-literal-struct-cast) — review/merge
that first; this branch's diff is only the wave-6 files.

Extends the Wycheproof adversarial-vector program to three implemented
primitives that had no coverage. All pass with no accepted forgeries.

ECDSA secp256k1 (DER + P1363)

The Bitcoin/Ethereum curve. DER runs through the real parse path
(tls13_cert.split_ecdsa_sig, coord 32) then secp256k1.ecdsa_verify — the
same DER-malleability surface wave 3 hardened for P-256; P1363 feeds raw r‖s to
the verifier for r/s-range and modular edge cases.

Ed448 signature verify

The decode/verify surface the ed25519 driver's tc151 forgery lived in
(non-canonical point encodings, small-order/identity points, s out of range,
wrong-length inputs), now covered for the larger curve. ed448.verify hashes
internally, so the message is passed raw.

AES-CMAC (RFC 4493)

Tag verification: recompute over (key, msg), truncate to the group tagSize,
compare. Forged/truncated tags reject; illegal key lengths (the 0/8/64/160/320-bit
groups) are rejected without invoking cmac on an unsupported key. Full sweep —
all 311 cases
(63 valid matched, 248 rejected).

Harness budgets

  • AES-CMAC: symmetric-fast, full sweep by default.
  • ECDSA secp256k1 (test_wycheproof_ecdsa_secp256k1.sh): bignum-heavy (~2s/verify),
    stride 10, ~46s for both forms.
  • Ed448 (~4s/verify) shares a slot with CMAC (test_wycheproof_ed448_cmac.sh),
    stride 4, ~49s together.
  • WYCHEPROOF_FULL=1 sweeps all. New wp_*.ae are covered by the existing
    tests/integration/wycheproof/ prune-prefix.

Vectors vendored byte-identical from C2SP/wycheproof at the pin already recorded
for wave 5 (3fa63dd).

🤖 Generated with Claude Code

Base automatically changed from compiler/warn-malloc-literal-struct-cast to main September 6, 2026 12:22
Stacks on the malloc-lint branch. Extends the adversarial-vector program to
three implemented primitives that had no Wycheproof coverage. All pass with no
accepted forgeries.

ECDSA secp256k1 (the Bitcoin/Ethereum curve), DER and P1363:
- DER runs through the real parse path (tls13_cert.split_ecdsa_sig, coord 32)
  then secp256k1.ecdsa_verify — the same DER-malleability surface wave 3
  hardened for P-256.
- P1363 feeds raw r||s to the verifier for the r/s-range and modular edge cases.

Ed448 signature verify: the decode/verify surface the ed25519 driver's tc151
forgery lived in (non-canonical point encodings, small-order/identity points,
s out of range, wrong-length inputs), now covered for the larger curve.
ed448.verify hashes internally, so the message is passed raw; wrong-length sigs
are rejected without calling verify (which expects a 114-byte buffer).

AES-CMAC (RFC 4493) tag verification: recompute over (key, msg), truncate to
the group tagSize, compare. Forged/truncated tags reject; illegal key lengths
(the 0/8/64/160/320-bit groups) are rejected without invoking cmac on an
unsupported key. Full sweep — all 311 cases (63 valid tags matched, 248
rejected).

Harness budgets: AES-CMAC is symmetric-fast (full sweep by default). ECDSA
secp256k1 verify is bignum-heavy (~2s each) so its runner strides at 10 (~46s
for both forms); Ed448 verify is ~4s each so it strides at 4, sharing a slot
with CMAC (~49s together). WYCHEPROOF_FULL=1 sweeps all. New wp_*.ae are
covered by the existing tests/integration/wycheproof/ prune-prefix.

Vectors vendored byte-identical from C2SP/wycheproof at the pin already recorded
for wave 5 (3fa63dd).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@paul-hammant
paul-hammant force-pushed the crypto/wycheproof-wave6 branch from ac6e911 to 6cc43d5 Compare September 6, 2026 12:25
@paul-hammant

Copy link
Copy Markdown
Collaborator Author

Rebased onto current origin/main now that #1924 (the lint + std sweep this was stacked on) has merged (facb70e7). The branch is a single clean commit over main — just the wave-6 files — and its CHANGELOG entry sits under [current] alongside #1924's merged entries with no duplication.

Re-verified on the rebased base: drivers build and pass (secp256k1, ed448, aes_cmac all ALL PASS), ae fmt gate clean. Ready for review whenever you have a moment. 🙂

@paul-hammant
paul-hammant merged commit cacb415 into main Sep 6, 2026
27 checks passed
@paul-hammant
paul-hammant deleted the crypto/wycheproof-wave6 branch September 6, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant