44Post-quantum cryptographic operations for Coldwire.
55
66Implements:
7- - Key generation (ML-KEM-1024 / Kyber, ML-DSA-87 / Dilithium5 )
7+ - Key generation (ML-KEM-1024, ML-DSA-87, Classic-McEliece-8192128f )
88- Signature creation and verification
99- One-Time Pad (OTP) encryption with padding
10- - Kyber-based OTP key exchange
10+ - Retrieving shared secrets from KEM chunks
1111- Secure random number generation
12-
13- Notes:
14- - Kyber keys and ciphertext sizes follow NIST spec for ML-KEM-1024.
15- - Dilithium5 keys/signature sizes follow NIST spec for ML-DSA-87.
16- - OTP padding randomizes message lengths to resist ciphertext length analysis.
12+ - OTP padding
1713"""
1814
1915import oqs
@@ -37,7 +33,7 @@ def create_signature(algorithm: str, message: bytes, private_key: bytes) -> byte
3733 Creates a digital signature for a message using a post-quantum signature scheme.
3834
3935 Args:
40- algorithm: PQ signature algorithm (e.g. "Dilithium5 ").
36+ algorithm: PQ signature algorithm (e.g. "ML-DSA-87 ").
4137 message: Data to sign.
4238 private_key: Private key bytes.
4339
@@ -52,7 +48,7 @@ def verify_signature(algorithm: str, message: bytes, signature: bytes, public_ke
5248 Verifies a post-quantum signature.
5349
5450 Args:
55- algorithm: PQ signature algorithm (e.g. "Dilithium5 ").
51+ algorithm: PQ signature algorithm (e.g. "ML-DSA-87 ").
5652 message: Original message data.
5753 signature: Signature to verify.
5854 public_key: Corresponding public key bytes.
@@ -68,7 +64,7 @@ def generate_sign_keys(algorithm: str = ML_DSA_87_NAME):
6864 Generates a new post-quantum signature keypair.
6965
7066 Args:
71- algorithm: PQ signature algorithm (default ML-DSA-87 / Dilithium5 ).
67+ algorithm: PQ signature algorithm (default ML-DSA-87).
7268
7369 Returns:
7470 (private_key, public_key) as bytes.
0 commit comments