Skip to content

Pure Rust implementation of (draft) FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

integritychain/ml-kem-rs

Repository files navigation

IntegrityChain FIPS 203 (Initial Public Draft): Module-Lattice-Based Key-Encapsulation Mechanism Standard

crate Docs Build Status Apache2/MIT licensed Rust Version

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);

Documentation

Security Notes

This crate is under construction.

USE AT YOUR OWN RISK!

Supported Parameter Sets

  • ML-KEM-512
  • ML-KEM-768
  • ML-KEM-1023

Minimum Supported Rust Version

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.

SemVer Policy

  • All on-by-default features of this library are covered by SemVer
  • MSRV is considered exempt from SemVer as noted above

License

All crates licensed under either of

at your option.

Contribution

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.

About

Pure Rust implementation of (draft) FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks