#[non_exhaustive]pub struct MlKem1024;Expand description
ML-KEM-1024 parameter set marker. NIST security category 5 (≈ AES-256). Required by CNSA 2.0 for NSS by 1 Jan 2027.
Module rank k = 4. Public key 1568 B, secret key 3168 B,
ciphertext 1568 B, shared secret 32 B.
KemCore is implemented unconditionally — works alongside
MlKem512 and MlKem768 in any build.
Implementations§
Source§impl MlKem1024
impl MlKem1024
Sourcepub const PUBLIC_KEY_BYTES: usize = 1568
pub const PUBLIC_KEY_BYTES: usize = 1568
Public encapsulation key length in bytes.
Sourcepub const SECRET_KEY_BYTES: usize = 3168
pub const SECRET_KEY_BYTES: usize = 3168
Private decapsulation key length in bytes.
Sourcepub const CIPHERTEXT_BYTES: usize = 1568
pub const CIPHERTEXT_BYTES: usize = 1568
Ciphertext length in bytes.
Sourcepub const SHARED_SECRET_BYTES: usize = 32
pub const SHARED_SECRET_BYTES: usize = 32
Shared-secret length in bytes.
Sourcepub const ALGORITHM_ID: &'static str = "ML-KEM-1024"
pub const ALGORITHM_ID: &'static str = "ML-KEM-1024"
Stable algorithm identifier per the IETF LAMPS draft.
Trait Implementations§
impl Copy for MlKem1024
impl Eq for MlKem1024
Source§impl KemCore for MlKem1024
impl KemCore for MlKem1024
Source§const ALGORITHM_ID: &'static str = "ML-KEM-1024"
const ALGORITHM_ID: &'static str = "ML-KEM-1024"
Stable algorithm identifier per the IETF LAMPS draft —
"ML-KEM-512", "ML-KEM-768", or "ML-KEM-1024".Source§const OID: &'static str = "2.16.840.1.101.3.4.4.3"
const OID: &'static str = "2.16.840.1.101.3.4.4.3"
Dotted-decimal object identifier per
2.16.840.1.101.3.4.4.{1,2,3}.Source§type EncapsulationKey = MlKem1024EncapKey
type EncapsulationKey = MlKem1024EncapKey
Encapsulation key (public side).
Source§type DecapsulationKey = MlKem1024DecapKey
type DecapsulationKey = MlKem1024DecapKey
Decapsulation key (secret side). Zeroized on drop.
Source§type Ciphertext = MlKem1024Ciphertext
type Ciphertext = MlKem1024Ciphertext
Ciphertext.
Source§fn generate<R: RngCore + CryptoRng>(
rng: &mut R,
) -> Result<(Self::DecapsulationKey, Self::EncapsulationKey), KyberLibError>
fn generate<R: RngCore + CryptoRng>( rng: &mut R, ) -> Result<(Self::DecapsulationKey, Self::EncapsulationKey), KyberLibError>
Generate a fresh decapsulation / encapsulation key pair. Read more
Source§fn generate_from_seed(
d: &[u8; 32],
z: &[u8; 32],
) -> Result<(Self::DecapsulationKey, Self::EncapsulationKey), KyberLibError>
fn generate_from_seed( d: &[u8; 32], z: &[u8; 32], ) -> Result<(Self::DecapsulationKey, Self::EncapsulationKey), KyberLibError>
Derive a key pair from the seed
(d, z): FIPS 203 Algorithm 16,
ML-KEM.KeyGen_internal(d, z). Read moreSource§impl MlKemParams for MlKem1024
impl MlKemParams for MlKem1024
Source§const ETA1: usize = 2
const ETA1: usize = 2
Centred-binomial width η₁ for the secret-key sampling.
3 for ML-KEM-512, 2 for ML-KEM-768 and ML-KEM-1024.
Source§const DU: usize = 11
const DU: usize = 11
Ciphertext compression bit-width for the u half. 10 for
ML-KEM-512/768, 11 for ML-KEM-1024.
Source§const DV: usize = 5
const DV: usize = 5
Ciphertext compression bit-width for the v half. 4 for
ML-KEM-512/768, 5 for ML-KEM-1024.
Source§const PUBLIC_KEY_BYTES: usize = 1568
const PUBLIC_KEY_BYTES: usize = 1568
Public encapsulation-key byte length.
K * 384 + 32 per FIPS 203 §6.Source§const SECRET_KEY_BYTES: usize = 3168
const SECRET_KEY_BYTES: usize = 3168
Secret decapsulation-key byte length.
24*K*N/8 + 96 per FIPS 203 §6.1.Source§const CIPHERTEXT_BYTES: usize = 1568
const CIPHERTEXT_BYTES: usize = 1568
Ciphertext byte length.
32*(K*DU + DV) per FIPS 203 §6.Source§const ALGORITHM_ID: &'static str = "ML-KEM-1024"
const ALGORITHM_ID: &'static str = "ML-KEM-1024"
Stable algorithm identifier —
"ML-KEM-512", "ML-KEM-768",
or "ML-KEM-1024".Source§const OID: &'static str = "2.16.840.1.101.3.4.4.3"
const OID: &'static str = "2.16.840.1.101.3.4.4.3"
Object identifier —
2.16.840.1.101.3.4.4.{1,2,3}.Source§type PublicKeyBytes = [u8; 1568]
type PublicKeyBytes = [u8; 1568]
Concrete encapsulation-key byte buffer type. Each impl
instantiates as
[u8; PUBLIC_KEY_BYTES].Source§type SecretKeyBytes = [u8; 3168]
type SecretKeyBytes = [u8; 3168]
Concrete decapsulation-key byte buffer type. Each impl
instantiates as
[u8; SECRET_KEY_BYTES]. Zeroized on drop
at the wrapper level (see crate::ml_kem).Source§type CiphertextBytes = [u8; 1568]
type CiphertextBytes = [u8; 1568]
Concrete ciphertext byte buffer type. Each impl instantiates
as
[u8; CIPHERTEXT_BYTES].Source§fn zero_public_key() -> Self::PublicKeyBytes
fn zero_public_key() -> Self::PublicKeyBytes
Create a new zeroed public-key buffer. Helper so generic code
can construct buffers without naming the concrete array size.
Source§fn zero_secret_key() -> Self::SecretKeyBytes
fn zero_secret_key() -> Self::SecretKeyBytes
Create a new zeroed secret-key buffer.
Source§fn zero_ciphertext() -> Self::CiphertextBytes
fn zero_ciphertext() -> Self::CiphertextBytes
Create a new zeroed ciphertext buffer.
Source§const SHARED_SECRET_BYTES: usize = 32
const SHARED_SECRET_BYTES: usize = 32
Shared-secret length in bytes. Always 32.
impl StructuralPartialEq for MlKem1024
Auto Trait Implementations§
impl Freeze for MlKem1024
impl RefUnwindSafe for MlKem1024
impl Send for MlKem1024
impl Sync for MlKem1024
impl Unpin for MlKem1024
impl UnsafeUnpin for MlKem1024
impl UnwindSafe for MlKem1024
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more