- Status: Accepted
- Date: 2026-11-13
Context
QuantLayer needs NIST post-quantum signatures (FIPS 204 ML-DSA, FIPS 205 SLH-DSA) and key encapsulation (FIPS 203 ML-KEM). It also needs hybrid authorization with classical keys, key rotation, revocation and algorithm migration, with Rust and TypeScript interoperating. ADR-0007 deferred the choice of implementation. The rule is that QuantLayer never implements lattice or hash-based cryptography itself.
Decision
- Implementations (exact pins).
libcrux-ml-kemandlibcrux-ml-dsa0.0.11 (Cryspen). These have the strongest assurance available: hax/F* verification of the portable code, complete for ML-KEM and partial for ML-DSA. Only the portable path is built.fips2050.5.0 (IntegrityChain) for SLH-DSA SHA2-128s, 128f and 256s.- RustCrypto, pqcrypto/PQClean and aws-lc-rs were evaluated (QUANTLAYER_QUANTUM.md §1) and not chosen.
- Module.
rust/quantlayer-pqcprovides:- algorithm ids, codes and versioning;
- seed-based key pairs;
- hedged signing with the FIPS external "pure" interface and contexts;
- ML-KEM with key checks;
- sealed private keys (XChaCha20-Poly1305 under a KMS KEK, metadata as AAD);
- hybrid Ed25519/ES256K + ML-DSA-65 (AND-composition, domain-separated);
KeyStorecustody with explicit states (pending, active, retired, revoked, destroyed), plus rotation and migration with dual-signed transition records.
- Bindings. Node-API (
rust/quantlayer-pqc-node, napi-rs), so secrets stay in Rust. The TypeScript package@quantlayer-protocol/pqc-enginedefines the stable interfacesPQCKeyProvider,PQCSignatureProvider,PQCVerificationProvider,HybridAuthorizationProviderandPQCKeyManager, and mirrors the lifecycle into@quantlayer-protocol/cryptoKeyRings. A WASM build is deferred until awasm32toolchain is available. - Assurance by vectors and independent implementations.
- 291 NIST ACVP cases from a pinned commit with a reproducible subset.
- Differential tests against
fips204/fips203. - Byte-identical interop with
@noble/post-quantumfrom TypeScript.
- Defaults. ML-DSA-65 and ML-KEM-768 (NIST category 3). SLH-DSA is for long-lived roots, where its hash-only assumption justifies the slow signing.
Consequences
- Building
@quantlayer-protocol/pqc-enginerequires cargo. CI installs Rust in the TypeScript job. The SDK does not re-export the native module, so browser and web builds need no Rust toolchain. - The module is not FIPS 140-3 validated. A validated provider can be put behind the same interfaces later.
- Ethereum transactions and the BN254 ZK proofs remain classical. The module protects QuantLayer authorizations and key agreement, not the chain.
- A library upgrade means changing the exact pins, rerunning all vector suites, reviewing advisories, and recording the change in this ADR.