Commit Graph

17 Commits

Author SHA1 Message Date
mnovak 5b9e3ee8fb test: v0.2.0 signature vectors (ACVP ML-DSA, Wycheproof, RFC 8032, RFC 10073)
Official vectors for the signature tests, fetched 2026-11-25 at the commits
docs/02_signatures.md names: ACVP keyGen and sigGen at 2972def2, sigVer at
a7f283cd (after the ModifyZ correction), Wycheproof at 20b25694, the
composite-sigs repository at f0627ab, and RFC 8032 section 7.1.

Files under about 1 MB are kept whole. The larger ones are reduced to their
ML-DSA-65 groups and a few cases per group by make_subsets.py, which checks
each original's sha256 and drops only whole cases and groups; RFC 8032's
vectors are extracted from the RFC text by extract_rfc8032.py. SOURCES.md
records the URL, commit, git blob, original sha256 and the selection of
every file.
2026-11-25 12:40:04 +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
mnovak 2fae9ad3eb Merge feature/arcanum: Day 1, Arcanum (PR #1)
X-Wing draft -11 (ML-KEM-768 + X25519) unmodified, a mutual exchange with the
full transcript bound in Arcanum's HKDF layer, the WireGuard PSK per 120 s
epoch, and a one-shot sealed box. Two QA reviews answered, R2-01 to R2-05
fixed. 82 tests passed in debug and release; fuzzed 631 s on 96086be with no
crash. Not audited.
v0.1.0
2026-11-25 09:37:59 +01:00
mnovak 9f8d1161ad docs: HANDOVER for v0.1.0, with the owner session's counts, mutation checks and fuzz run 2026-11-25 09:37:57 +01:00
mnovak 96086be4b3 docs: R2-01 to R2-05 decisions, canonical pk_X, and rules for Arcanum's consumers 2026-11-25 08:37:11 +01:00
mnovak 6780abc0c2 fix: QA second review R2-01 to R2-05
R2-01: PublicKey::encapsulate, SecretKey::decapsulate and SharedSecret::as_bytes
are hazmat-only; release consumers reach keys only through exchange and seal.
R2-02: PublicKey::from_bytes refuses a non-canonical X25519 half (bit 255 set,
or a value of at least 2^255 - 19). Honest keys and the draft vectors pass.
R2-03: schedule::expand takes one static label and one fixed-width field, so
its info is injective by signature. v1 bytes unchanged (golden vectors pass).
R2-04: generate, initiate, respond and seal say the RNG must be the OS RNG.
R2-05: Initiation is ZeroizeOnDrop; seal's buffer stays Zeroizing until the
plaintext in it is encrypted, so the MessageTooLong path wipes it.
QA's A-33 case for PublicKey::encapsulate moves to exchange::respond, and its
A-08 test pins the new expand signature to the v1 encoding.
2026-11-25 08:37:11 +01:00
mnovak f3e17f3d5c test(qa): A-29 allocator probe, secrets wiped before their heap memory is freed
A separate, unpublished crate with its own workspace (like fuzz/), because a
GlobalAlloc needs unsafe and arcanum keeps forbid(unsafe_code). dealloc scans
each freed block for a 32-byte canary. Controls prove it sees an unwiped Vec
and the reallocation case; checked by adding a reserve(1) after decryption in
open(), which it catches. Heap only: stack copies are out of its reach.
2026-11-25 08:16:44 +01:00
mnovak f31872d0d5 test(qa): compile-fail checks against a default-features consumer (A-33, A-34, R2-01)
Builds a throwaway crate that depends on arcanum without features and runs
cargo check --offline on small programs: the safe API compiles (control), a
non-CryptoRng RNG is refused (A-33), and no _derand/from_seed entry point is
reachable (A-34). Each was checked by reintroducing the bug.

qa_r2_01_raw_shared_secret_is_not_reachable_without_hazmat FAILS on purpose:
PublicKey::encapsulate(..).1.as_bytes() hands a release consumer the raw
one-way X-Wing secret, the single-direction PSK that A-15 rules out.
2026-11-25 08:16:44 +01:00
mnovak 3dfc75075f test(qa): second review, A-03/A-06/A-08/A-09/A-18/A-28/A-30/A-31 and R2-02 (non-canonical pk_X)
Completes the partial QA cases and adds the not-done ones that need no new
dependency: compile-time checks that no secret type is Copy, Clone, PartialEq
or Display (A-28, A-31, hand-rolled assert_not_impl), ZeroizeOnDrop markers,
redacted Debug, no input bytes in errors (A-30), distinct secrets for all 1120
ciphertext flips (A-03), a spliced key (A-06), deterministic implicit rejection
(A-18), and the KDF-encoding and purpose-separation unit tests (A-08, A-09).

qa_r2_02_non_canonical_x25519_public_key_is_refused FAILS on purpose: a pk_X
with bit 255 set parses, and the exchange then silently derives mismatched PSKs.
2026-11-25 08:16:44 +01:00
mnovak 853f59ca60 fix: report an over-long plaintext as MessageTooLong, not DecryptionFailed 2026-11-25 07:48:55 +01:00
mnovak e0c6d53a99 docs: record D-QA-1, the mutual exchange (A-15), the hazmat gate (A-35) and the corrected ml-kem fact 2026-11-25 07:47:46 +01:00
mnovak 91b84459b0 test: frozen v1 golden vectors for PSKs and the sealed format (QA A-10, A-38) 2026-11-25 07:42:27 +01:00
mnovak 6233c8244e test: hygiene check sees arcanum's own features; A-15 binding goes through session_prk 2026-11-25 07:40:57 +01:00
mnovak 89b5329f06 feat: X-Wing (draft -11), mutual exchange, WireGuard PSK per epoch, sealed box
X-Wing is composed from ml-kem, x25519-dalek, sha3 and shake and matches the
draft's vectors. The PSK comes from a mutual exchange (each peer encapsulates
to the other, QA A-15) bound to the full transcript in Arcanum's own HKDF layer
(QA D-QA-1). Low-order X25519 values are refused. Deterministic entry points
sit behind the off-by-default hazmat feature, enabled only for the tests.
2026-11-25 07:38:55 +01:00
mnovak c7d050ed65 test: the six mandatory tests, pinned KAT vectors, fuzz target and cargo-deny config (written before the code) 2026-11-25 07:28:48 +01:00
mnovak ed9b8a3b17 docs: Day 1 analysis (X-Wing draft -11, key schedule, PSK rotation) and threat model 2026-11-25 07:23:10 +01:00
mnovak 9b4d2c40d3 chore: licence (CPAL-1.0), gitignore, CLAUDE.md and README 2026-11-25 07:15:55 +01:00