0007. Cryptography isolated behind interfaces and deferred

Design document, published from the repository at docs/adr/0007-cryptography-isolation.md.

  • Status: Accepted (classical primitives amended by ADR-0009)
  • Date: 2026-11-13

Context

QuantLayer will combine classical signatures, post-quantum KEM/signatures and zero-knowledge proofs. Choosing algorithms, parameter sets, libraries and the proving system requires a dedicated design and threat-model review (CRYPTOGRAPHY.md, THREAT_MODEL.md), which has not happened yet.

Decision

  • No cryptographic functionality is implemented in the foundation stage.
  • packages/crypto holds interfaces only. Key material is referenced through handles (Signer, Decapsulator) so HSM/KMS/WASM backends fit.
  • Implementations will live only in rust/quantlayer-pqc (exposed via rust/quantlayer-crypto-wasm and adapted by packages/pqc-engine) and in packages/zk-engine / circuits/. No other package may import a crypto library directly.
  • Identifiers such as ML-KEM/ML-DSA parameter sets are listed for typing only; listing is not selection.
  • EVM address checksum (EIP-55) validation is deferred because it needs Keccak-256.

Consequences

Domain code can be written and tested now against stable interfaces. The interfaces are provisional and may change when CRYPTOGRAPHY.md is ratified.