Skip to content

feat: Post-Quantum signature support — ML-DSA (FIPS 204) + ML-KEM (FIPS 203) #21

Description

@cschanhniem

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

  1. 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.
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions