QuDAG Crypto
Quantum-resistant cryptographic primitives for the QuDAG protocol.
Features
- ML-KEM-768: NIST-standardized key encapsulation mechanism (FIPS 203)
- ML-DSA (Dilithium): Digital signature algorithm (FIPS 204)
- HQC: Hamming Quasi-Cyclic code-based encryption (128/192/256-bit)
- BLAKE3: Fast cryptographic hash function
- Quantum Fingerprinting: Data fingerprinting using ML-DSA signatures
- Memory Safety: Automatic secret zeroization and constant-time operations
Quick Start
Add to your Cargo.toml:
[]
= "0.1"
Examples
ML-KEM Key Encapsulation
use MlKem768;
// Generate keypair
let = keygen?;
// Encapsulate to get shared secret
let = encapsulate?;
// Decapsulate to recover shared secret
let shared_secret2 = decapsulate?;
assert_eq!;
ML-DSA Digital Signatures
use ;
// Generate signing keypair
let keypair = generate?;
let message = b"Hello, quantum-resistant world!";
// Sign message
let signature = keypair.sign?;
// Verify signature
assert!;
BLAKE3 Hashing
use HashFunction;
let data = b"Data to hash";
let hash = hash;
println!;
Quantum Fingerprinting
use Fingerprint;
let data = b"Important data";
let fingerprint = generate?;
// Verify data integrity
assert!;
Security Features
- Post-Quantum Security: Resistant to attacks from quantum computers
- Memory Safety: All secret data is automatically zeroized
- Side-Channel Resistance: Constant-time implementations
- NIST Compliance: Implements FIPS 203 and FIPS 204 standards
Supported Algorithms
| Algorithm | Type | Security Level | Standard |
|---|---|---|---|
| ML-KEM-768 | Key Encapsulation | NIST Level 3 | FIPS 203 |
| ML-DSA | Digital Signatures | NIST Level 3 | FIPS 204 |
| HQC-128/192/256 | Encryption | 128/192/256-bit | NIST Round 4 |
| BLAKE3 | Hash Function | 256-bit | RFC Draft |
Performance
QuDAG Crypto is optimized for performance with:
- SIMD acceleration where available
- Efficient memory management
- Minimal allocation overhead
- Hardware feature detection
Documentation
License
Licensed under either MIT or Apache-2.0 at your option.