Skip to content

test(ed25519): pin the attestation primitive to RFC 8032 published vectors#48

Merged
zemo-g merged 1 commit into
masterfrom
test/ed25519-rfc8032-vectors
Jul 8, 2026
Merged

test(ed25519): pin the attestation primitive to RFC 8032 published vectors#48
zemo-g merged 1 commit into
masterfrom
test/ed25519-rfc8032-vectors

Conversation

@zemo-g

@zemo-g zemo-g commented Jul 8, 2026

Copy link
Copy Markdown
Owner

The signature scheme every attestation rests on had zero automated tests — flagged in today's audit as the most on-thesis gap in the repo. Four known-answer tests join the compiled-in suite (178 → 182), each probed standalone against the seed before embedding:

  • TEST 1 (empty msg) and TEST 2 (1-byte msg) verify
  • Tamper rejection: TEST 1 with a flipped R byte and a flipped S byte both reject
  • Sign KAT: the deterministic sign path reproduces TEST 3 byte-for-byte — pk derivation and the full 64-byte signature (exercises ed25519_sign + ed25519_scalar + sha512 end to end)

Vectors come from the RFC text itself (ietf.org/rfc/rfc8032.txt §7.1), not memory or a third-party library.

Full discipline: seed rebuilt across three self-compile generations (gen2 == gen3 byte-identical), 182/182 on the installed seed, docs/STATUS.md regenerated (seed 44e28d47…, 9232 loc, 102 stdlib modules), rail_safe rebuilt through its 19/19 gate (hash == seed), and every current-state count swept across README/CONTRIBUTING/VERIFY/tests/SHIMS/STRUCTURE.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pb4TJEdqhSKkRdLsDYD2JF

…ctors

The signature scheme every attestation in this project rests on had zero
automated tests. Four known-answer tests join the compiled-in suite
(178 -> 182), each probed standalone against the seed before embedding:

- ed25519_rfc8032_t1_verify: TEST 1 (empty message) verifies
- ed25519_rfc8032_t2_verify: TEST 2 (1-byte message) verifies
- ed25519_reject_tampered:   TEST 1 with a flipped R byte and a flipped
  S byte both reject
- ed25519_sign_rfc8032_t3:   the deterministic sign path reproduces
  TEST 3 byte-for-byte — pk derivation AND the 64-byte signature
  (exercises ed25519_sign + ed25519_scalar + sha512 end to end)

Vectors were taken from the RFC text itself (ietf.org/rfc/rfc8032.txt
section 7.1), not from memory or a third-party library.

Seed rebuilt through the full discipline: three self-compile
generations, gen2 == gen3 byte-identical, 182/182 on the installed
seed, docs/STATUS.md regenerated (seed 44e28d47…, 9232 loc, 102 stdlib
modules — the 102nd landed with #41 this morning), rail_safe rebuilt
through its 19/19 adversarial gate (hash matches the seed, per
convention), and every current-state 178/101 doc reference swept
(historical release sections left as they were — true at their tags).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pb4TJEdqhSKkRdLsDYD2JF
@zemo-g zemo-g merged commit 5bc1264 into master Jul 8, 2026
3 checks passed
@zemo-g zemo-g deleted the test/ed25519-rfc8032-vectors branch July 8, 2026 19:44
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