# Gap Matrix β quantum-shield vs. production-grade
Baseline: a general-purpose, production-grade hybrid post-quantum
cryptography library. Updated as of **v0.2.1** on branch
`claude/crate-analysis-2gpwdm`.
**Legend:** β
done Β· π‘ partial Β· β missing Β· β¬ out of scope by design (v2)
Gap-closing shipped across releases: **0.2.1** (assurance/tooling),
**0.2.2** (hardening: no_std, constant-time, PKCS#8/PEM), **0.3.0**
(features: multi-recipient, streaming, rotation). The section tables mark
which release landed each item. The remaining open items are external
(audit, supply-chain attestation) β see the end.
## 1. Cryptographic core
| Hybrid KEM (X25519 + ML-KEM-1024), KDF-combined | β
| SHA3-256 combiner over both secrets + full transcript (`src/hybrid_kem.rs`) |
| Hybrid signatures (Ed25519 + ML-DSA-87), both mandatory | β
| Non-short-circuit verify, `verify_strict` (`src/sign.rs`) |
| AEAD payload (AES-256-GCM) with header bound as AAD | β
| `src/seal.rs` |
| FIPS 203/204 algorithms (final, not round-3) | β
| RustCrypto `ml-kem` 0.3 / `ml-dsa` 0.1 |
| Domain separation + injective framing | β
| Labels + length-prefixed context |
| Combiner is standard X-Wing (ML-KEM-768) | π‘ | Deliberately adapted to ML-KEM-1024; not the ratified draft. No formal proof for the ported construction |
| Randomized ("hedged") ML-DSA signing | β | Deterministic only; `ml-dsa` 0.1 doesn't expose hedged path |
| Multi-recipient encryption | β
| `seal_multi`/`open_multi` (`QSM2`), recipient set bound into payload (0.3.0) |
| Streaming / chunked AEAD for >64 MiB | β
| `StreamSealer`/`StreamOpener` (`QST2`), STREAM construction (0.3.0) |
| Key rotation (signed oldβnew attestation) | β
| `key_id` + `RotationAttestation` (`QSR2`) (0.3.0) |
| Forward secrecy for recipient (ratchet) | β¬ | Static recipient KEM keys; rotation gives bounded-exposure re-keying, not per-message FS |
| Authenticated sender (signcryption) | β¬ | `seal` is anonymous by design |
## 2. Side-channel & memory hardening
| Zeroization of private key material | β
| Seeds + shared secrets, `zeroize`/`Zeroizing` |
| `Debug` redaction of secrets | β
| `KeyPair`/`PublicKeyBundle` |
| Uniform decryption/verification errors (no oracle) | β
| `Error::DecryptionFailed` carries no detail |
| Constant-time primitives | π‘ | Inherited from dalek/RustCrypto; not independently verified, but now regression-checked (below) |
| Constant-time regression harness (dudect) | β
| `examples/dudect.rs` on `open`; low t locally; non-gating CI (0.2.2) |
| Fault-injection / EM resistance | β | No claims, no mitigations |
## 3. API & interoperability
| seal/open, sign/verify, key export/import | β
| `src/api.rs`, `src/lib.rs` |
| Versioned binary wire format, unknown-version rejection | β
| `src/wire.rs`, `docs/design.md` |
| serde support (optional feature) | β
| `src/serde_impls.rs` |
| Interop with an independent implementation | π‘ | Format is specified (`docs/design.md`) but no second implementation validated against it |
| Standard key encodings (PKCS#8/SPKI/PEM) | β
| `pem` feature: per-component SPKI PEM for ML-KEM/ML-DSA/Ed25519, raw block for X25519 (0.2.2) |
| `no_std` support | β
| `#![no_std]` + `alloc`; bare-metal CI gate (`thumbv7em-none-eabi`) (0.2.2) |
| Async API | β¬ | Removed; ops are CPU-bound, not IO-bound |
## 4. Testing & QA
| Unit + integration tests (61 total) | β
| lib + roundtrip/tamper/downgrade |
| Adversarial: byte-flip, splice, downgrade, stripping | β
| `tests/tamper.rs`, `tests/downgrade.rs` |
| Property-based tests | β
| `tests/proptests.rs` |
| Wire-format golden / KAT vectors | β
| Self-generated (`tests/golden.rs`, `src/hybrid_kem.rs`) |
| RFC 7748 / RFC 8032 sanity vectors | β
| `tests/kat_x25519.rs`, `tests/kat_ed25519.rs` (0.2.1) |
| ML-KEM / ML-DSA in-crate vectors | π‘ | `tests/kat_mlkem.rs`, `tests/kat_mldsa.rs` pin param-set/sizes/derivation (0.2.1); full ACVP conformance stays upstream |
| Fuzzing (`cargo-fuzz`) of all parsers | β
| `fuzz/` β six targets, all `from_bytes` + roundtrips (0.2.1) |
| Benchmarks (`criterion`) | β
| `benches/crypto.rs`, `benches/codec.rs` (0.2.1) |
| Coverage measurement | β
| `cargo-llvm-cov` β Codecov CI job (0.2.1, non-gating) |
## 5. CI, supply chain & release
| Multi-OS CI incl. macOS arm64 (Apple Silicon) | π‘ | Workflow runs on `claude/**` pushes now; the arm64 job is green **once the push CI completes** (verify on GitHub) |
| fmt + clippy (`-D warnings`) + doc | β
| `.github/workflows/ci.yml` |
| MSRV (1.85) check | β
| Dedicated job |
| `cargo-deny` (advisories/licenses/sources) | β
| `deny.toml` |
| SemVer breakage check (`cargo-semver-checks`) | β
| CI job vs. the 0.2.0 baseline commit (0.2.1) |
| Signed releases / SLSA provenance / SBOM | β | No supply-chain attestation |
| Git tags for releases | π‘ | Tags created locally; this environment's remote rejects tag pushes, so release refs are commit SHAs |
| `cargo publish` dry-run passes | β
| Verified locally |
## 6. Docs, governance & assurance
| README, design spec, threat model, migration guide | β
| `docs/design.md`, `docs/security-model.md`, `docs/migration-v1-to-v2.md` |
| Honest "not audited / not FIPS-validated" disclosure | β
| README + SECURITY.md |
| Threat model with explicit non-goals | β
| `docs/security-model.md` |
| Independent third-party security audit | β | **Largest gap** for a security-critical library |
| Formal verification of the combiner/framing | β | No machine-checked proof |
| FIPS validation | β¬ | Not attainable for a pure-Rust crate without a CAVP/CMVP program |
## Remaining gaps (post-0.2.1)
Closed in 0.2.1: parser fuzzing, RFC/ML-KEM/ML-DSA in-crate vectors, criterion
benchmarks, coverage, `cargo-semver-checks`. Closed in 0.2.2: `no_std`+`alloc`
(bare-metal CI gate), dudect constant-time regression harness, PKCS#8/PEM
public-key interop. Closed in 0.3.0: multi-recipient envelopes, streaming
AEAD, key rotation. Still open:
1. **Confirm the Apple Silicon CI gate is green** β CI runs on this branch;
verify the `macos-15` job passed on GitHub (the requirement isn't met until
it does).
2. **Signed releases / SLSA / SBOM** β supply-chain attestation.
3. **Independent audit** β the one gap that external work, not code, must close
before "production-grade" is fully honest.
The code-level gaps from the original matrix are now closed; what remains is
external assurance (audit) and release-infrastructure (attestation) work.