Skip to main content

KemAlgorithm

Enum KemAlgorithm 

Source
#[repr(u16)]
pub enum KemAlgorithm { MlKem512 = 257, MlKem768 = 258, MlKem1024 = 259, XWing = 513, }
Expand description

Supported Key Encapsulation Mechanism (KEM) algorithms.

Variants§

§

MlKem512 = 257

NIST FIPS 203 ML-KEM-512 (NIST Security Category 1).

§

MlKem768 = 258

NIST FIPS 203 ML-KEM-768 (NIST Security Category 3).

§

MlKem1024 = 259

NIST FIPS 203 ML-KEM-1024 (NIST Security Category 5).

§

XWing = 513

IETF/CFRG X-Wing Hybrid KEM (ML-KEM-768 + X25519, NIST Category 3 + Classical 128-bit).

Implementations§

Source§

impl KemAlgorithm

Source

pub const fn wire_id(self) -> u16

Stable 16-bit big-endian wire identifier used in AgilePublicKey and Envelope headers.

Source

pub const fn from_wire_id(id: u16) -> Result<Self>

Parses a 16-bit wire identifier.

Source

pub const fn name(self) -> &'static str

Canonical human-readable algorithm name (suitable for CBOM / inventory reporting).

Source

pub const fn nist_category(self) -> u8

NIST Post-Quantum Security Category (1, 3, or 5).

Source

pub const fn is_hybrid(self) -> bool

Returns true if this algorithm combines both classical and post-quantum security.

Source

pub const fn oid(self) -> Option<&'static str>

Returns the official RFC 9935 / NIST CSOR OID string if standardized for X.509/PKCS#8.

Trait Implementations§

Source§

impl Clone for KemAlgorithm

Source§

fn clone(&self) -> Self

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 KemAlgorithm

Source§

impl Debug for KemAlgorithm

Source§

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

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

impl Eq for KemAlgorithm

Source§

impl Hash for KemAlgorithm

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for KemAlgorithm

Source§

fn eq(&self, other: &Self) -> 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 KemAlgorithm

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.