IntegrityChain FIPS 203 (Initial Public Draft): Module-Lattice-Based Key-Encapsulation Mechanism Standard
mlKem Module-Lattice-Based Key-Encapsulation Mechanism Standard written in pure Rust.
Very simple to use, per the following example.
// Use the desired target parameter set
use ml_kem_rs::ml_kem_512; // Could also be ml_kem_1024 or ml_kem_768
// Alice runs KeyGen, and then serializes ek for Bob (to bytes)
let (alice_ek, alice_dk) = ml_kem_512::key_gen();
let alice_ek_bytes = alice_ek.to_bytes();
// Alice sends ek bytes to Bob
let bob_ek_bytes = alice_ek_bytes;
// Bob deserializes ek bytes, runs Encaps, to get ssk and serializes ct for Alice (to bytes)
let bob_ek = ml_kem_512::new_ek(bob_ek_bytes);
let (bob_ssk_bytes, bob_ct) = bob_ek.encaps();
let bob_ct_bytes = bob_ct.to_bytes();
// Bob sends ct bytes to Alice
let alice_ct_bytes = bob_ct_bytes;
// Alice deserializes runs Decaps
let alice_ct = ml_kem_512::new_ct(alice_ct_bytes);
let alice_ssk_bytes = alice_dk.decaps(&alice_ct);
// Alice and Bob will now have the same secret key
assert_eq!(bob_ssk_bytes, alice_ssk_bytes);
This crate is under construction.
USE AT YOUR OWN RISK!
- ML-KEM-512
- ML-KEM-768
- ML-KEM-1023
Rust 1.72 or higher.
Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump.
- All on-by-default features of this library are covered by SemVer
- MSRV is considered exempt from SemVer as noted above
All crates licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.