crypto-inventory 0.3.0: glob imports resolved, libcrux and spqr, libsignal KEM key pairs; control-plane: a key agreement or client-side TLS called by the application itself is not routed to the TLS gateway (planner 35/35, B1 negative control 4/4)
This commit is contained in:
1 parent
f2f6217b4c
commit
f971fa9e28
11 files changed
+161
-30
No files matched your search
@@ -0,0 +1,16 @@
|
||||
// Fixtura: Rust cu import glob (`use crate::*`): un nume nerezolvat prin `use` se incearca pe crate-urile aduse cu `*`, in ordinea
|
||||
// lor, si se accepta primul care are un inteles acolo. Si libcrux (ML-KEM, ML-DSA), bibliotecile de sub libsignal.
|
||||
use libsignal_protocol::*;
|
||||
use libcrux_ml_kem::mlkem1024;
|
||||
use libcrux_ml_dsa::ml_dsa_65;
|
||||
use rand::rngs::OsRng;
|
||||
|
||||
pub fn chei(randomness: [u8; 64], msg: &[u8]) {
|
||||
let mut rng = OsRng;
|
||||
let kyber = kem::KeyPair::generate(kem::KeyType::Kyber1024, &mut rng); // EXPECT: Kyber-1024 | quantum-safe
|
||||
let identity = IdentityKeyPair::generate(&mut rng); // EXPECT: X25519 | quantum-vulnerable
|
||||
let kp = mlkem1024::generate_key_pair(randomness); // EXPECT: ML-KEM-1024 | quantum-safe
|
||||
let (ct, ss) = mlkem1024::encapsulate(kp.public_key(), randomness[..32].try_into().unwrap()); // EXPECT: ML-KEM-1024 | quantum-safe
|
||||
let sig = ml_dsa_65::sign(&ml_dsa_65::generate_key_pair(randomness).signing_key, msg, b"", randomness[..32].try_into().unwrap()); // EXPECT: ML-DSA-65 | quantum-safe
|
||||
let _ = (kyber, identity, ct, ss, sig);
|
||||
}
|
||||
Reference in new issue
Block a user