Module pq
Expand description
Post-quantum hybrid cryptographic primitives (ML-DSA-65 + ML-KEM-768).
Always compiled (M3 #152). Whether these are USED is a runtime decision via
hyprstream_rpc::crypto::CryptoPolicy, not a compile-time cargo feature. Provides:
- ML-DSA-65 (FIPS 204) digital signatures
- ML-KEM-768 (FIPS 203) key encapsulation
Functions§
- ml_
dsa_ generate_ keypair - ml_
dsa_ sign - ml_
dsa_ sk_ from_ seed - Reconstruct an ML-DSA-65 signing key from its 32-byte seed.
- ml_
dsa_ sk_ to_ seed - Serialize an ML-DSA-65 signing key to its 32-byte seed.
- ml_
dsa_ sk_ to_ vk - Derive the ML-DSA-65 verifying key from a signing key.
- ml_
dsa_ sk_ to_ vk_ bytes - Derive the raw ML-DSA-65 verifying-key bytes (1952 bytes) from a signing key.
- ml_
dsa_ verify - ml_
dsa_ vk_ bytes - ml_
dsa_ vk_ from_ bytes - ml_
kem_ decaps_ from_ seed - Reconstruct an ML-KEM-768 decapsulation key from its 64-byte FIPS 203 seed
(
d ‖ z). Deterministic — the matching encapsulation key is recovered via [MlKemDecapsKey::encapsulation_key]. This 64-byte seed is the canonical byte form used by the hybrid-KEM component (#551) and by#mesh-kemkey derivation (#552), mirroringml_dsa_sk_from_seed. - ml_
kem_ decapsulate - ml_
kem_ dk_ to_ seed - Serialize an ML-KEM-768 decapsulation key to its 64-byte seed.
- ml_
kem_ ek_ bytes - ml_
kem_ ek_ from_ bytes - ml_
kem_ ek_ of_ dk - The encapsulation-key bytes (1184 B) corresponding to a decapsulation key.
- ml_
kem_ encapsulate - Encapsulate a shared secret. Returns
(ciphertext, shared_secret). - ml_
kem_ generate_ keypair