5 Commits

Author SHA1 Message Date
mnovak 0b2480bf83 docs: QA S-04, S-07, S-08, S-12 as gaps; the expanded key is 35 kB on the stack
- The expanded ML-DSA-65 key is 34,992 bytes on the stack (QA measured;
  A_hat's rows are boxed inside ml-dsa), not 64 kB, and it is exactly the
  secret part. src/sign.rs and docs/02_signatures.md corrected.
- S-04: ml-dsa's signing loop leaves rnd, rho'' and y on the stack; a
  leaked y gives s1. Recorded in docs/02 and docs/THREAT_MODEL.md, with the
  key-construction stack copy.
- S-07: under open question 1, the recommendation for Day 3: a separate,
  freshly generated composite identity, never a wrapped Tessera Ed25519
  seed (RFC 10073 3.1); from_bytes cannot detect reuse (also on its docs).
- S-08: verify_binding does not tie id to vk and has no serial; both are
  the caller's, with the Day 3 replay rule (QA E-07); also on its docs.
- S-12: decoded on 2026-11-26, none of the 9 ML-DSA-65 "modified z" sigVer
  cases at a7f283cd reaches the z infinity-norm bound (max 524,077 <
  524,092), so no ACVP case could be added; only Wycheproof covers it.
- S-05, S-10, S-11 noted under "As built" and gaps.
2026-11-26 03:49:56 +01:00
mnovak 274cf37d69 docs: verification timing does show which half failed, harmlessly (QA S-06)
The design doc, VerifyingKey::verify and Error::InvalidSignature claimed
that both halves are always checked so timing does not tell which failed.
Not so: a malformed ML-DSA half is refused at decode without verification,
and verify_strict returns early on a bad R (QA measured 59/187/217 us
against 225 us). The docs now say the error does not name the half, the
timing may, and that is fine because verification uses only public data
(RFC 10073 3.3 allows failing early). The `&` and its comment, which
bought nothing (both booleans were already computed), become a plain `&&`.
No behaviour change.
2026-11-26 03:46:47 +01:00
mnovak abcc375741 fix: AppContext::new is a const fn over a &'static label (QA S-09)
A label is one fixed string per purpose; taking any runtime bytes let a
consumer derive it from a peer name, a file name or a message field, and
two purposes could then collide. AppContext::new now takes
&'static [u8] and is a const fn, so contexts are built as consts and a bad
label fails the consumer's build; there is no runtime constructor (the
simplest API: one constructor, no escape hatch until a need appears).

Tests: a const OK and a const EMPTY context; sig_hygiene refuses a
consumer that passes a runtime Vec (E0597/E0716); the one test that needs
runtime labels (flipping label bytes) leaks them on purpose. The random
labels in sig_malformed and fuzz mode 5's AppContext part are dropped (the
raw-ctx part of mode 5 stays). A doctest shows the const pattern, and
docs/02_signatures.md says so.
2026-11-26 03:45:39 +01:00
mnovak d56ee10f0d docs: HANDOVER for v0.2.0, the as-built notes and the answered verify_strict gap
HANDOVER: the builder's counts (121 tests in debug and release, clippy,
fmt, the zeroize probe, deny, audit, a 605 s fuzz run with no crash), seven
mutation checks, the vector sources, and what is not verified.

docs/02_signatures.md: an "As built" section (the raw interface stays
hedged, the canonical Ed25519 key check, label lengths, the order of the
binding checks, crate features); the gap on verify_strict is answered (it
accepts both RFC 10073 vectors and agrees with all 151 Wycheproof
verdicts), and the subsets and stack copies are listed as gaps. The app
context prefix in the AppContext paragraph is corrected to
domi/arcanum/v2/sig/app/.

README: signatures in the summary, a usage sketch, the new fuzz target.
2026-11-25 13:46:43 +01:00
mnovak c7294612ae docs: v0.2.0 design, hybrid signatures ML-DSA-65 + Ed25519 per RFC 10073
Mark decided on 2026-11-25 to add post-quantum signatures before Day 3, so
exchanged X-Wing keys can be authenticated post-quantum. The construction is
RFC 10073 id-MLDSA65-Ed25519-SHA512, byte for byte, on ml-dsa =0.1.2 and
ed25519-dalek =3.0.0. Covers the crate choices and the API traps (the crate's
Signer/Verifier traits use an empty context and sign deterministically), the
Arcanum contexts, a key-binding helper, the eight mandatory tests with their
vector sources (ACVP after the 2026-07-31 sigVer correction, Wycheproof, the
RFC's Appendix E), risks and gaps. Tests and code follow.
2026-11-25 11:10:31 +01:00