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

Arcanum

Arcanum is the shared post-quantum crypto core of the Domi ecosystem. It is one small Rust crate that gives every Domi product a hybrid key exchange: ML-KEM-768 (FIPS 203) combined with X25519, so a shared secret stays safe as long as either of the two holds.

Since v0.2.0 it also signs: a hybrid ML-DSA-65 + Ed25519 signature, exactly RFC 10073 id-MLDSA65-Ed25519-SHA512, which stays unforgeable while either half holds, and a helper that binds an X-Wing public key to its owner.

Via Domi uses it first, to derive and rotate the WireGuard pre-shared key. Canalis, Custos sealing and Tabellarius are expected to adopt it later.

  • No primitive is written here. ML-KEM, X25519, ML-DSA, Ed25519, SHA-2, SHA-3, HKDF and ChaCha20-Poly1305 come from vetted RustCrypto and dalek crates.
  • No I/O, no network, no clock. Randomness is passed in by the caller.
  • No unsafe code.

Use

let init = arcanum::exchange::initiate(&my_secret, &peer_public, context, &mut rng)?;
// send init.ciphertext() to the peer, which calls exchange::respond and sends back ct_ri
let session = init.finish(&ct_ri)?;
let psk = session.wireguard_psk(arcanum::epoch_at(unix_seconds)); // one exchange per 120 s epoch
let ctx = arcanum::sign::AppContext::new(b"plans")?;
let sig = signing_key.sign(plan_bytes, &ctx, &mut rng)?;          // 3373 bytes
signing_key.verifying_key().verify(plan_bytes, &ctx, &sig)?;       // 1984-byte public key
let binding = arcanum::sign::bind_kem_key(&signing_key, device_id, xwing_sk.public_key(), (from, until), &mut rng)?;

Checks

cargo test                 # KATs, binding, epochs, malformed input, golden vectors, feature graph
cargo deny check
cargo audit
cargo +nightly fuzz run --release untrusted_input -- -max_total_time=600
cargo +nightly fuzz run --release signatures -- -max_total_time=600

Not audited. Nothing here is called secure before an external audit.

The design, the risks and the threat model are in docs/.

Licence

CPAL-1.0, see LICENSE. Attribution Information (Exhibit B): "Built on Domi", Copyright (c) 2026 Marek Novák, https://aula.marek-novak.cz.

S
Description
Hybrid post-quantum key exchange (ML-KEM-768 + X25519) for the Domi ecosystem
Readme 4.1 MiB
Languages
Rust 96.6%
Python 3.2%
Nix 0.2%