mnovak 5a52854ccc feat: hybrid signatures ML-DSA-65 + Ed25519, RFC 10073 id-MLDSA65-Ed25519-SHA512
arcanum::sign, as docs/02_signatures.md sets out. M' = Prefix || Label ||
u8(len ctx) || ctx || SHA-512(M), built on the stack. The ML-DSA-65 half is
ExpandedSigningKey::sign_randomized(M', ctx = Label, rng), hedged; the
Ed25519 half is pure Ed25519 over M' (try_sign), checked with verify_strict.
Verification computes both halves before answering, and returns one
InvalidSignature whichever failed. ml-dsa's Signer/Verifier traits,
sign_deterministic and sign_mu_deterministic are never called.

- SigningKey: two 32-byte seeds (RFC 10073's private key format), the
  expanded ML-DSA key boxed; ZeroizeOnDrop, not Clone, Debug redacted.
- VerifyingKey: 1984 bytes; refuses an Ed25519 half that is not a point,
  not its canonical encoding, or of small order (InvalidVerifyingKey).
- AppContext: only "domi/arcanum/v2/sig/app/" + a 1..=231-byte label.
- bind_kem_key / verify_binding: an X-Wing public key bound to a key id and
  an inclusive validity window under "domi/arcanum/v2/sig/kem-key"; the
  message is hashed field by field; window and id are checked first, then
  the signature, then now (InvalidValidity, TooLong, InvalidSignature,
  OutsideValidity).
- sign_composite_raw / verify_composite_raw: the bare RFC ctx, hazmat only.
  They still take an RNG (the ML-DSA half stays hedged), not the
  deterministic variant the doc mentions.
- Error gains TooLong, InvalidVerifyingKey, InvalidSignature,
  SigningFailed, InvalidValidity, OutsideValidity; Input gains SigningKey,
  VerifyingKey, Signature, Context, KeyId.

Also fixes tests/kat_mldsa65.rs, which passed a &[&Vec<u8>] to
sign_internal and did not compile.

cargo test (debug): 121 passed, 0 failed (82 from v0.1.0, golden_v1
unchanged). clippy --all-targets --all-features -D warnings: clean.
2026-11-25 13:12:22 +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.

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, 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

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

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%