Expand description
Post-Quantum Cryptography Module for ZAP
Provides ML-KEM-768 key exchange, ML-DSA-65 signatures, and hybrid X25519+ML-KEM handshake.
§Security
This module implements NIST FIPS 203 (ML-KEM) and FIPS 204 (ML-DSA) standards for post-quantum cryptographic protection. The hybrid handshake combines classical X25519 with ML-KEM-768 for defense-in-depth.
§Example
ⓘ
use zap::crypto::{PQKeyExchange, PQSignature, HybridHandshake};
// Key exchange
let alice = PQKeyExchange::generate()?;
let (ciphertext, shared_alice) = alice.encapsulate(&bob_pk)?;
let shared_bob = bob.decapsulate(&ciphertext)?;
assert_eq!(shared_alice, shared_bob);
// Signatures
let signer = PQSignature::generate()?;
let sig = signer.sign(b"message")?;
signer.verify(b"message", &sig)?;
// Hybrid handshake
let initiator = HybridHandshake::initiate()?;
let (responder, response) = HybridHandshake::respond(&initiator.public_data())?;
let shared = initiator.finalize(&response)?;Structs§
Constants§
- HYBRID_
SHARED_ SECRET_ SIZE - Hybrid shared secret size after HKDF
- MLDSA_
PUBLIC_ KEY_ SIZE - ML-DSA-65 public key size in bytes
- MLDSA_
SECRET_ KEY_ SIZE - ML-DSA-65 secret key size in bytes
- MLDSA_
SIGNATURE_ SIZE - ML-DSA-65 signature size in bytes
- MLKEM_
CIPHERTEXT_ SIZE - ML-KEM-768 ciphertext size in bytes
- MLKEM_
PUBLIC_ KEY_ SIZE - ML-KEM-768 public key size in bytes
- MLKEM_
SHARED_ SECRET_ SIZE - ML-KEM-768 shared secret size in bytes
- X25519_
PUBLIC_ KEY_ SIZE - X25519 public key size in bytes