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
2026-11-25 08:37:11 +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%