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.
This commit is contained in:
+31
-3
@@ -101,7 +101,7 @@ pub mod sign {
|
||||
}
|
||||
```
|
||||
|
||||
`AppContext` is a newtype that can only be built with the `domi/arcanum/v2/sig/` prefix, so a caller can
|
||||
`AppContext` is a newtype that can only be built with the `domi/arcanum/v2/sig/app/` prefix, so a caller can
|
||||
never pass an empty or foreign context by accident. The bare RFC interface (any ctx, deterministic ML-DSA)
|
||||
exists only under `hazmat`, for the known-answer tests. Verification returns one error,
|
||||
`Error::InvalidSignature`, whichever half failed, and checks both halves before answering, so timing does not
|
||||
@@ -134,6 +134,27 @@ RustCrypto's own ACVP copies predate the sigVer correction, so Arcanum runs the
|
||||
| Signing can fail (rejection sampling bound) | a panic in a release build | 0.1.2 returns an error from the hedged path; Arcanum surfaces it as `Error::SigningFailed`; the deterministic `sign_mu_deterministic` (documented to panic) is never called |
|
||||
| A 1984-byte key and a 3373-byte signature | larger control messages | fine over the control channel; noted for Day 5's QR import (classic keys only there) |
|
||||
|
||||
## As built (v0.2.0, `src/sign.rs`)
|
||||
|
||||
Where the code differs from, or adds to, the design above (the code wins):
|
||||
|
||||
- **The raw interface stays hedged.** `sign_composite_raw(sk, msg, ctx, rng)` and
|
||||
`verify_composite_raw(vk, msg, ctx, sig)` take any `ctx` of 0 to 255 bytes but still sign through
|
||||
`sign_randomized` with the caller's RNG; there is no deterministic ML-DSA path in Arcanum at all.
|
||||
A test that needs repeatable bytes passes a seeded RNG. Both are `hazmat` only.
|
||||
- **A stricter Ed25519 key check.** `ed25519-dalek`'s `VerifyingKey::from_bytes` accepts y >= p and
|
||||
a set sign bit on x = 0. Arcanum re-encodes the point and refuses any encoding that is not the
|
||||
canonical one, as well as small-order points (`Error::InvalidVerifyingKey`). Invisible to honest
|
||||
keys and to the RFC's vectors.
|
||||
- **App labels are 1 to 231 bytes** (`MAX_APP_LABEL_LEN` = 255 minus the 24-byte prefix); an empty
|
||||
label is `TooShort`, a longer one `TooLong`.
|
||||
- **Key bindings** are hashed field by field (no allocation); the window is inclusive at both ends;
|
||||
`verify_binding` checks, in this order, the window's shape and the id length
|
||||
(`InvalidValidity`, `TooLong`), the signature (`InvalidSignature`), then `now`
|
||||
(`OutsideValidity`), so `OutsideValidity` always means an authentic but expired binding.
|
||||
- `ml-dsa` gets `alloc` (its large vectors are boxed), `rand_core` and `zeroize`, default features
|
||||
off; `ed25519-dalek` gets only `zeroize` (not `fast`: no precomputed tables).
|
||||
|
||||
## Gaps
|
||||
|
||||
- **Not audited**, like v0.1.0; the Day 7 audit pack covers both versions.
|
||||
@@ -141,8 +162,15 @@ RustCrypto's own ACVP copies predate the sigVer correction, so Arcanum runs the
|
||||
- No HashML-DSA and no X.509: not needed.
|
||||
- The RFC's signing vectors are hedged, so the composite has no byte-exact signing KAT; byte-exact checks exist
|
||||
for the ML-DSA half (ACVP deterministic groups) and Ed25519.
|
||||
- Whether `verify_strict` refuses any RFC 10073 vector is not known yet; test 3 will say. If it does, the
|
||||
vector, the decision and the reason go here.
|
||||
- ~~Whether `verify_strict` refuses any RFC 10073 vector~~: **it does not.** Test 3 (2026-11-25) verifies
|
||||
both the RFC's `s` (empty ctx) and `sWithContext` with `verify_strict`, through Arcanum and through the
|
||||
independent rebuild of M'. `verify_strict` also agrees with all 151 Wycheproof `ed25519_test.json` verdicts
|
||||
(test 2: no disagreement to list).
|
||||
- ACVP sigGen, sigVer and Wycheproof `mldsa_65_verify` run as subsets (`tests/vectors/SOURCES.md`): 18 of
|
||||
the sigGen cases, 15 sigVer cases, 70 of 210 Wycheproof verify cases. The full files' sha256 are pinned,
|
||||
so the subsets can be rechecked against them by rerunning `make_subsets.py`.
|
||||
- Stack copies: building a `SigningKey` moves the expanded ML-DSA key (about 64 kB) through the stack
|
||||
before it is boxed; the allocator probe sees only the heap (as in v0.1.0's threat model).
|
||||
|
||||
## Questions (none blocks the work)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user