Feature request: Post-quantum cryptographic primitives
Now that NIST has standardized FIPS 204 (ML-DSA / Dilithium) and FIPS 203 (ML-KEM / Kyber), adding post-quantum support to rscrypto would align the crate with the emerging PQC landscape. Several Rust crypto crates (pqcrypto-*, ml-kem, libcrux) already have implementations, but none under rscryptos "one coherent primitive stack" model.
Why rscrypto is well-positioned
- no_std + WASM support — PQC primitives are especially valuable in embedded and WASM contexts (IoT firmware signing, WASM module attestation). rscryptos existing no_std / WASM target model maps directly.
- zero default deps — Introducing PQC via the rscrypto API surface means projects get lattice-based KEM/signatures under the same
default-features = false discipline, without pulling in a separate libcrux or pqcrypto-* tree.
- Benchmarking infrastructure — rscryptos existing CI benchmark harness (with per-primitive scorecards) would immediately show ML-KEM vs. ECDH and ML-DSA vs. Ed25519 overhead, helping users make informed trade-offs.
Suggested scope
Phase 1: ML-KEM (Kyber, FIPS 203)
rscrypto::kem::MlKem512 / MlKem768 / MlKem1024
encapsulate(&pk) → (ciphertext, shared_secret)
decapsulate(&sk, ciphertext) → shared_secret
- Key generation, serialization,
no_std-compatible randomness interface
Phase 2: ML-DSA (Dilithium, FIPS 204)
rscrypto::sign::MlDsa44 / MlDsa65 / MlDsa87
sign(&sk, message) → signature
verify(&pk, message, signature) → Result
- Deterministic vs. hedged signing (FIPS 204 §5.2)
Implementation considerations
- Portable Rust first — lattice operations are polynomial-ring arithmetic in Zq[X]/(X^n+1); a clean portable impl is the reference, with AVX2/Neon acceleration added later (existing rscrypto pattern).
- Constant-time — ML-KEM and ML-DSA both require rejection sampling and bit packing that must be constant-time to avoid side channels. rscryptos existing
portable-only feature would provide the audit-safe path.
- NIST KAT vectors — official ACVP test vectors exist for both standards; integration-testing against them is feasible.
- Crate scope — these would live under a
pqc feature flag (or ml-kem, ml-dsa leaf features), keeping the full feature including them without pulling them in unconditionally.
References
Would this fit the rscrypto roadmap? Happy to help scope the API further.
Feature request: Post-quantum cryptographic primitives
Now that NIST has standardized FIPS 204 (ML-DSA / Dilithium) and FIPS 203 (ML-KEM / Kyber), adding post-quantum support to rscrypto would align the crate with the emerging PQC landscape. Several Rust crypto crates (
pqcrypto-*,ml-kem,libcrux) already have implementations, but none under rscryptos "one coherent primitive stack" model.Why rscrypto is well-positioned
default-features = falsediscipline, without pulling in a separatelibcruxorpqcrypto-*tree.Suggested scope
Phase 1: ML-KEM (Kyber, FIPS 203)
rscrypto::kem::MlKem512/MlKem768/MlKem1024encapsulate(&pk) → (ciphertext, shared_secret)decapsulate(&sk, ciphertext) → shared_secretno_std-compatible randomness interfacePhase 2: ML-DSA (Dilithium, FIPS 204)
rscrypto::sign::MlDsa44/MlDsa65/MlDsa87sign(&sk, message) → signatureverify(&pk, message, signature) → ResultImplementation considerations
portable-onlyfeature would provide the audit-safe path.pqcfeature flag (orml-kem,ml-dsaleaf features), keeping thefullfeature including them without pulling them in unconditionally.References
benches/directory in repoWould this fit the rscrypto roadmap? Happy to help scope the API further.