Enum KEM

Source
pub enum KEM {
    DHKEM_P256_HKDF_SHA256,
    DHKEM_P384_HKDF_SHA384,
    DHKEM_P521_HKDF_SHA512,
    DHKEM_X25519_HKDF_SHA256,
    DHKEM_X448_HKDF_SHA512,
}
Expand description

§Key Encapsulation Mechanisms (KEMs)

ValueKEMNsecretNencNpkNskAuthReference
0x0000(reserved)N/AN/AN/AN/AyesN/A
0x0010DHKEM(P-256, HKDF-SHA256)32656532yesNISTCurves, RFC5869
0x0011DHKEM(P-384, HKDF-SHA384)48979748yesNISTCurves, RFC5869
0x0012DHKEM(P-521, HKDF-SHA512)6413313366yesNISTCurves, RFC5869
0x0020DHKEM(X25519, HKDF-SHA256)32323232yesRFC7748, RFC5869
0x0021DHKEM(X448, HKDF-SHA512)64565656yesRFC7748, RFC5869

The Auth column indicates if the KEM algorithm provides the AuthEncap()/AuthDecap() interface and is therefore suitable for the Auth and AuthPSK modes. The meaning of all other columns is explained below. All algorithms are suitable for the PSK mode.

§KEM Identifiers

The “HPKE KEM Identifiers” registry lists identifiers for key encapsulation algorithms defined for use with HPKE. These identifiers are two-byte values, so the maximum possible value is 0xFFFF = 65535.

Template:

  • Value: The two-byte identifier for the algorithm
  • KEM: The name of the algorithm
  • Nsecret: The length in bytes of a KEM shared secret produced by the algorithm
  • Nenc: The length in bytes of an encoded encapsulated key produced by the algorithm
  • Npk: The length in bytes of an encoded public key for the algorithm
  • Nsk: The length in bytes of an encoded private key for the algorithm
  • Auth: A boolean indicating if this algorithm provides the AuthEncap()/AuthDecap() interface
  • Reference: Where this algorithm is defined

Variants§

§

DHKEM_P256_HKDF_SHA256

0x0010

§

DHKEM_P384_HKDF_SHA384

0x0011

§

DHKEM_P521_HKDF_SHA512

0x0012

§

DHKEM_X25519_HKDF_SHA256

0x0020

§

DHKEM_X448_HKDF_SHA512

0x0021

Trait Implementations§

Source§

impl Clone for KEM

Source§

fn clone(&self) -> KEM

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for KEM

Source§

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

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

impl PartialEq for KEM

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for KEM

Source§

impl StructuralPartialEq for KEM

Auto Trait Implementations§

§

impl Freeze for KEM

§

impl RefUnwindSafe for KEM

§

impl Send for KEM

§

impl Sync for KEM

§

impl Unpin for KEM

§

impl UnwindSafe for KEM

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V