Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
pqc-combo v0.1.0 NO KAT TEST
Pure Rust Post-Quantum Cryptography Library with FIPS 140-3 Support
A production-ready, no_std compatible cryptography library implementing NIST-standardized post-quantum algorithms with optional FIPS 140-3 compliance features.
๐ Website: www.pqc-combo.com
๐ฆ Crate: crates.io/crates/pqc-combo
๐ Documentation: docs.rs/pqc-combo
๐ Repository: github.com/AaronSchnacky1/pqc-combo
โจ Features
๐งช Testing
Cryptographic Algorithms
-
ML-KEM-1024 (Kyber) - FIPS 203, Security Level 5
- Key Encapsulation Mechanism for secure key exchange
- 1568-byte public keys, 3168-byte private keys
- 32-byte shared secrets
-
ML-DSA-65 (Dilithium) - FIPS 204, Security Level 3
- Digital signature algorithm for authentication
- 1952-byte public keys, 4032-byte private keys
- 3309-byte signatures
-
AES-256-GCM - FIPS 197 & SP 800-38D
- Authenticated encryption with associated data
- Optional feature for hybrid encryption schemes
FIPS 140-3 Compliance Features
When the fips_140_3 feature is enabled, the library includes:
-
โ Pre-Operational Self-Tests (POST)
- Cryptographic Algorithm Self-Tests (CASTs) for hash functions
- Known Answer Tests (KATs) for ML-KEM and ML-DSA
- Pair-wise Consistency Tests (PCTs) for key generation
-
โ State Machine
- Enforces proper initialization before cryptographic operations
- States: Uninitialized โ POST โ Operational โ Error
-
โ CSP Controls
- Prevents plaintext export of secret keys in FIPS mode
- Automatic key zeroization on drop
- Keys only accessible through approved APIs
Platform Support
- โ
no_std+no_alloc- Bare metal / embedded systems - โ
no_std+alloc- Embedded with allocator - โ
std- Full standard library with OS RNG
๐ Quick Start
Add to your Cargo.toml:
[]
= "0.1"
Basic Usage
use *;
// Key Encapsulation (KEM)
let keys = generate_key_pair;
let = encapsulate_shared_secret;
let shared_secret_receiver = decapsulate_shared_secret;
assert_eq!;
// Digital Signatures
let = generate_dilithium_keypair;
let message = b"Hello, Post-Quantum World!";
let signature = sign_message;
assert!;
FIPS 140-3 Mode
use *;
// Run Pre-Operational Self-Tests
run_post.expect;
// Generate keys with Pair-wise Consistency Test
let keys = generate_key_pair_with_pct
.expect;
// Use keys normally
let = encapsulate_shared_secret;
no_std Usage
use *;
// Bring your own entropy source
let seed: = get_hardware_entropy;
// Generate keys from seed
let keys = generate_key_pair_with_seed;
๐ Feature Flags
| Feature | Description | Default |
|---|---|---|
std |
Standard library support, enables OS RNG | โ |
alloc |
Allocator support, required for AES-GCM | โ |
ml-kem |
ML-KEM-1024 (Kyber) algorithm | โ |
ml-dsa |
ML-DSA-65 (Dilithium) algorithm | โ |
aes-gcm |
AES-256-GCM symmetric encryption | โ |
fips_140_3 |
FIPS 140-3 compliance features | โ |
Configuration Examples
# Default: Full featured with std
= "0.1"
# FIPS mode
= { = "0.1", = ["fips_140_3"] }
# Minimal no_std
= { = "0.1", = false, = ["ml-kem", "ml-dsa"] }
# no_std with allocator and AES
= { = "0.1", = false, = ["alloc", "ml-kem", "ml-dsa", "aes-gcm"] }
๐ Security
Algorithm Security Levels
- ML-KEM-1024: NIST Security Level 5 (equivalent to AES-256)
- ML-DSA-65: NIST Security Level 3 (equivalent to AES-192)
- AES-256-GCM: 256-bit security
Implementation Security
- โ Pure Rust - Memory safety guaranteed by Rust
- โ Constant-time operations - Via libcrux implementations
- โ Automatic zeroization - Secret keys cleared on drop
- โ No unsafe code - In the public API surface
- โ FIPS 140-3 ready - Self-tests and state machine included
Security Considerations
- RNG Quality: Use hardware RNG in production environments
- Side-channel resistance: Implementations use constant-time operations where possible
- Key management: Secret keys are automatically zeroized, but ensure proper key lifecycle management
- Not yet certified: FIPS 140-3 certification is in progress
See SECURITY.md for more details.
๐ Performance
Measured on modern x86_64 hardware (November 2024):
| Operation | Time | Throughput |
|---|---|---|
| ML-KEM-1024 KeyGen | 12.2 ยตs | ~81,900 ops/sec |
| ML-KEM-1024 Encapsulate | 12.9 ยตs | ~77,500 ops/sec |
| ML-KEM-1024 Decapsulate | 13.7 ยตs | ~72,900 ops/sec |
| ML-DSA-65 KeyGen | 29.8 ยตs | ~33,500 ops/sec |
| ML-DSA-65 Sign | 80.2 ยตs | ~12,470 ops/sec |
| ML-DSA-65 Verify | 29.1 ยตs | ~34,360 ops/sec |
Key Insights:
- ๐ All operations complete in under 100 microseconds
- ๐ ML-KEM is faster than RSA-2048 for key exchange
- ๐ ML-DSA is competitive with ECDSA for signatures
- ๐ Pure Rust with no performance compromises
Run cargo bench to measure on your hardware. See PERFORMANCE_BENCHMARKS.md for detailed analysis.
๐ ๏ธ Development Status
โ Completed
- Pure Rust implementations via libcrux
-
no_stdsupport (bare metal to full std) - ML-KEM-1024 (Kyber) implementation
- ML-DSA-65 (Dilithium) implementation
- AES-256-GCM integration
- FIPS 140-3 state machine
- Pair-wise Consistency Tests (PCT)
- Hash function CASTs
- Known Answer Tests (KATs) for ML-KEM and ML-DSA
- CSP controls and zeroization
- Comprehensive test suite
๐ง In Progress
- FIPS 140-3 certification documentation
- Additional algorithm support (ML-KEM-768, ML-DSA-87)
๐ Planned
- C FFI wrapper (separate crate)
- Python bindings
- WebAssembly support
- Hardware acceleration
- Formal verification
๐ Documentation
- API Documentation: Run
cargo doc --open - FIPS 140-3 Security Policy: See docs/FIPS_140_3_SECURITY_POLICY.md
- FIPS 140-3 User Guide: See docs/FIPS_140_3_USER_GUIDE.md
- Testing Guide: See docs/TESTING_GUIDE.md
- Security Policy: See SECURITY.md
- Changelog: See CHANGELOG.md
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- libcrux - Pure Rust cryptographic implementations
- NIST - Post-quantum cryptography standardization
- Rust Crypto - Cryptographic primitives ecosystem
๐ง Contact
Author: Aaron Schnacky
Email: aaronschnacky@gmail.com
Website: www.pqc-combo.com
GitHub: @AaronSchnacky1
For security issues, please see SECURITY.md for responsible disclosure process.
โ ๏ธ Disclaimer
This software is provided "as is" without warranty of any kind. While it implements NIST-standardized algorithms and includes FIPS 140-3 compliance features, it has not yet completed FIPS 140-3 certification. Use in production environments should be evaluated based on your specific security requirements.
Built with โค๏ธ in Rust | Securing tomorrow's communications today