Architecture and Envelope Format
The primitive layer uses types to distinguish keys and signatures, and provides ML-KEM, ML-DSA, SLH-DSA, SHA-3, and other primitives with no_std. quantaegis-drbg provides SHA-256, HMAC, HMAC_DRBG, and health tests for raw noise sources. The hybrid layer combines primitives with classical cryptography. The SDK handles scheme identifiers, key storage formats, policies, and envelopes. Python exposes this SDK as well; C and JS/WASM let callers invoke individual schemes using buffers or byte arrays. See the language support table.
Opening an Envelope v1
QAEN is a QuantAegis-specific format shared by the Rust SDK and Python. The public C and JS/WASM APIs work with individual primitives.
| Order | Stored content |
|---|---|
| Fixed header (10 bytes) | Magic QAEN, version, KEM ID, AEAD ID, KEM ciphertext length |
| Variable-length header | KEM ciphertext |
| Message | AEAD ciphertext and 16-byte authentication tag |
- The sender’s
sealperforms encapsulation each time, then feeds the header and shared secret into SHAKE256 with a purpose-specific label to derive a 32-byte AEAD key and 12-byte nonce. - It encrypts the message with AES-256-GCM or ChaCha20-Poly1305. The complete header and caller-provided AAD, including its length, are authenticated.
- The recipient can use
inspectto route the envelope before decryption. The header’s authenticity is established only whenopensucceeds with the matching private key and the same AAD.
During key rotation, encrypt with the new public key and pass both old and new private keys to the recipient’s open_with_keyring. If policy is tightened first and the old scheme is prohibited, previously stored data using that scheme can no longer be opened. See the Rust envelope specification · Python usage.