kylix_pqc/
lib.rs

1//! # Kylix
2//!
3//! A post-quantum cryptography library implementing NIST FIPS standards.
4//!
5//! ## Features
6//!
7//! - `std` (default): Enable standard library support
8//! - `ml-kem` (default): Enable ML-KEM (FIPS 203) key encapsulation
9//!
10//! ## Supported Algorithms
11//!
12//! - **ML-KEM** (FIPS 203): Module-Lattice-Based Key Encapsulation Mechanism
13//!   - ML-KEM-512
14//!   - ML-KEM-768
15//!   - ML-KEM-1024
16//!
17//! ## Example
18//!
19//! ```ignore
20//! use kylix::ml_kem::{MlKem768, Kem};
21//!
22//! // Generate a key pair
23//! let (dk, ek) = MlKem768::keygen(&mut rng)?;
24//!
25//! // Encapsulate a shared secret
26//! let (ct, ss_sender) = MlKem768::encaps(&ek, &mut rng)?;
27//!
28//! // Decapsulate the shared secret
29//! let ss_receiver = MlKem768::decaps(&dk, &ct)?;
30//!
31//! assert_eq!(ss_sender, ss_receiver);
32//! ```
33
34#![cfg_attr(not(feature = "std"), no_std)]
35#![warn(missing_docs)]
36#![warn(clippy::all)]
37#![deny(unsafe_code)]
38
39pub use kylix_core::{Error, Result};
40
41/// Core traits for cryptographic primitives.
42pub mod traits {
43    pub use kylix_core::{Kem, Signer};
44}
45
46/// ML-KEM (FIPS 203) key encapsulation mechanism.
47#[cfg(feature = "ml-kem")]
48pub mod ml_kem {
49    pub use kylix_core::Kem;
50    pub use kylix_ml_kem::*;
51}