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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.