Skip to main content

MlKem1024

Struct MlKem1024 

Source
#[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

Source

pub const K: usize = 4

Module rank.

Source

pub const PUBLIC_KEY_BYTES: usize = 1568

Public encapsulation key length in bytes.

Source

pub const SECRET_KEY_BYTES: usize = 3168

Private decapsulation key length in bytes.

Source

pub const CIPHERTEXT_BYTES: usize = 1568

Ciphertext length in bytes.

Source

pub const SHARED_SECRET_BYTES: usize = 32

Shared-secret length in bytes.

Source

pub const ALGORITHM_ID: &'static str = "ML-KEM-1024"

Stable algorithm identifier per the IETF LAMPS draft.

Source

pub const OID: &'static str = crate::oid::ML_KEM_1024

Object identifier — 2.16.840.1.101.3.4.4.3.

Trait Implementations§

Source§

impl Clone for MlKem1024

Source§

fn clone(&self) -> MlKem1024

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MlKem1024

Source§

impl Debug for MlKem1024

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MlKem1024

Source§

impl KemCore for MlKem1024

Source§

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"

Dotted-decimal object identifier per 2.16.840.1.101.3.4.4.{1,2,3}.
Source§

type EncapsulationKey = MlKem1024EncapKey

Encapsulation key (public side).
Source§

type DecapsulationKey = MlKem1024DecapKey

Decapsulation key (secret side). Zeroized on drop.
Source§

type Ciphertext = MlKem1024Ciphertext

Ciphertext.
Source§

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>

Derive a key pair from the seed (d, z): FIPS 203 Algorithm 16, ML-KEM.KeyGen_internal(d, z). Read more
Source§

impl MlKemParams for MlKem1024

Source§

const K: usize = 4

Module rank k. 2 / 3 / 4 for ML-KEM-512 / 768 / 1024.
Source§

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

Ciphertext compression bit-width for the u half. 10 for ML-KEM-512/768, 11 for ML-KEM-1024.
Source§

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

Public encapsulation-key byte length. K * 384 + 32 per FIPS 203 §6.
Source§

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

Ciphertext byte length. 32*(K*DU + DV) per FIPS 203 §6.
Source§

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"

Object identifier — 2.16.840.1.101.3.4.4.{1,2,3}.
Source§

type PublicKeyBytes = [u8; 1568]

Concrete encapsulation-key byte buffer type. Each impl instantiates as [u8; PUBLIC_KEY_BYTES].
Source§

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]

Concrete ciphertext byte buffer type. Each impl instantiates as [u8; CIPHERTEXT_BYTES].
Source§

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

Create a new zeroed secret-key buffer.
Source§

fn zero_ciphertext() -> Self::CiphertextBytes

Create a new zeroed ciphertext buffer.
Source§

const ETA2: usize = 2

Centred-binomial width η₂ for the ciphertext-noise sampling. Always 2.
Source§

const N: usize = 256

Polynomial degree N. Always 256.
Source§

const Q: usize = 3329

Modulus q. Always 3329.
Source§

const SHARED_SECRET_BYTES: usize = 32

Shared-secret length in bytes. Always 32.
Source§

const SYM_BYTES: usize = 32

Symmetric primitive byte length (seeds, hashes). Always 32.
Source§

impl PartialEq for MlKem1024

Source§

fn eq(&self, other: &MlKem1024) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MlKem1024

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.