Skip to main content

Module pq

Module pq 

Source
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-kem key derivation (#552), mirroring ml_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

Type Aliases§

MlDsaSignature
MlDsaSigningKey
MlDsaVerifyingKey
MlKemDecapsKey
MlKemEncapsKey