qv-core
The Rust core of QuantumVault — post-quantum cryptographic tokens that are quantum-safe, authenticated, encrypted, and replay-protected.
[]
= { = "4.2", = ["falcon"] }
What you get
| Primitive | Algorithm | Size |
|---|---|---|
| Signature (default) | ML-DSA-87 (Dilithium-5, NIST FIPS 204) | 4 627 B |
| Signature (Falcon-512) | Falcon-512 (PQClean, NIST FIPS 206 draft) | ≤ 666 B |
| Signature (Falcon-1024) | Falcon-1024 | ≤ 1 280 B |
| AEAD | XChaCha20-Poly1305 | 24 B nonce |
| Hash | SHA3-256 | 32 B |
| Replay protection | HYDRA mutation chain (stateful) | 8 B counter |
Issuing a token
use ;
let = generate_keypair?;
let encrypt_key = ;
let mut chain = new;
let mut claims = new;
claims.insert;
claims.insert;
let token = issue_token?;
let bytes = token.to_bytes; // wire format
Verifying
let parsed = from_bytes?;
let verify_chain = from_state;
let out = verify_token?;
assert_eq!;
Falcon
Falcon-512 signatures are 7.1× smaller than ML-DSA-87 and verify roughly
6× faster. Enable the falcon feature (on by default) and use the dedicated
entry points:
use ;
let = generate_keypair?;
let token = issue_token_falcon512?;
The falcon feature links PQClean via cc, so it requires a C toolchain.
For wasm32-unknown-unknown and other targets without a C compiler, build
with default-features = false for ML-DSA-only.
7-layer verification pipeline
Every verify_token call runs:
- Structural — MAGIC / VERSION / SUITE
- Entropy — KOLMOGOROV compression-ratio check on the nonce
- Temporal — not yet valid / expired
- Signature — ML-DSA-87 or Falcon, depending on suite
- Decryption — XChaCha20-Poly1305 AEAD
- Replay — mutation-chain counter monotonicity
- Claims — MessagePack-subset well-formedness
License
Apache-2.0. See LICENSE.