qcomm-core
Post-quantum cryptographic primitives for secure communication.
Features
- ML-KEM-1024 - NIST FIPS 203 post-quantum key encapsulation
- SPHINCS+-SHA2-256f - NIST FIPS 205 post-quantum signatures
- PQ Triple Ratchet - Forward-secure messaging protocol using ML-KEM
- AES-256-GCM - Authenticated symmetric encryption
- STARK Proofs - Zero-knowledge event authentication via Winterfell
Installation
[]
= { = "0.1", = ["native-crypto"] }
Quick Start
Key Exchange with ML-KEM-1024
use ;
// Bob generates a keypair
let bob_keypair = generate?;
// Alice encapsulates a shared secret to Bob's public key
let = bob_keypair.public_key.encapsulate?;
// Bob decapsulates to get the same shared secret
let bob_secret = bob_keypair.decapsulate?;
assert_eq!;
Digital Signatures with SPHINCS+
use SphincsKeyPair;
let keypair = generate?;
let message = b"Hello, post-quantum world!";
// Sign
let signature = keypair.sign?;
// Verify
assert!;
Forward-Secure Messaging with Triple Ratchet
use ;
// Initial key exchange (e.g., via PQXDH)
let bob_keypair = generate?;
let = bob_keypair.public_key.encapsulate?;
// Alice initiates
let mut alice = init_initiator?;
// Bob responds
let mut bob = init_responder?;
// Alice encrypts
let = alice.encrypt?;
// Bob decrypts
let plaintext = bob.decrypt?;
Security Properties
| Property | Algorithm | NIST Standard |
|---|---|---|
| Key Encapsulation | ML-KEM-1024 | FIPS 203 |
| Digital Signatures | SPHINCS+-SHA2-256f | FIPS 205 |
| Symmetric Encryption | AES-256-GCM | FIPS 197 |
| Key Derivation | HKDF-SHA256 | RFC 5869 |
Forward Secrecy
The Triple Ratchet protocol provides:
- Forward secrecy: Compromise of current keys doesn't expose past messages
- Post-compromise security: Future messages secure after recovery
- Post-quantum resistance: All key exchanges use ML-KEM
Feature Flags
| Feature | Description |
|---|---|
native-crypto |
Full PQ crypto (ML-KEM, SPHINCS+, networking) |
ble |
Bluetooth Low Energy transport |
qrng |
Hardware quantum random number generator support |
qkd |
Quantum Key Distribution integration |
Part of QuantumHarmony
This crate is part of the QuantumHarmony ecosystem:
- qcomm-core - This crate: PQ crypto primitives
- qcomm-wasm - WebAssembly bindings for browsers
- qcomm-ffi - FFI bindings for mobile (Swift/Kotlin)
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.