9 releases

0.0.7 Feb 12, 2026
0.0.7-pre.2 Feb 11, 2026
0.0.6 Jan 22, 2026
0.0.4 Nov 5, 2025
0.0.3 Sep 10, 2025

#236 in Cryptography

Download history 44/week @ 2025-11-15 13/week @ 2025-11-22 3/week @ 2025-11-29 6/week @ 2025-12-06 142/week @ 2025-12-13 78/week @ 2025-12-20 341/week @ 2025-12-27 148/week @ 2026-01-03 742/week @ 2026-01-10 1058/week @ 2026-01-17 1126/week @ 2026-01-24 625/week @ 2026-01-31 619/week @ 2026-02-07 622/week @ 2026-02-14 588/week @ 2026-02-21 740/week @ 2026-02-28

2,673 downloads per month
Used in 4 crates

Apache-2.0

755KB
16K SLoC

ML-DSA

This crate implements all three ML-DSA (FIPS 204) variants 44, 65, and 87, and includes both a portable implementation and an optimized SIMD implementation for Intel AVX2-enabled platforms.

Verification

verified

The portable and AVX2 code for field arithmetic, NTT polynomial arithmetic, and serialization is formally verified using hax and F*.

Usage

 use rand::{rngs::OsRng, RngCore};

 // Ensure you use good randomness.
 // It is not recommended to use OsRng directly!
 // Instead it is highly encouraged to use RNGs like NISTs DRBG to account for
 // bad system entropy.
 fn random_array<const L: usize>() -> [u8; L] {
     let mut rng = OsRng;
     let mut seed = [0; L];
     rng.try_fill_bytes(&mut seed).unwrap();
     seed
 }

 use libcrux_ml_dsa::*;

 // This example uses ML-DSA-65. The other variants can be used the same way.

 // Generate a key pair.
 let randomness = random_array();
 let key_pair = ml_dsa_65::generate_key_pair(randomness);

 // Generate a random message.
 let message = random_array::<1024>();

 // Sign this random message
 let randomness = random_array();
 let signature = ml_dsa_65::sign(key_pair.signing_key, &message, randomness);

 // Verify the signature and assert that it is indeed valid
 assert!(ml_dsa_65::verify(key_pair.verification_key, &message, signature).is_ok());

Dependencies

~2.5MB
~49K SLoC