Struct hpke::kem::DhP256HkdfSha256

source ·
pub struct DhP256HkdfSha256;
Expand description

Represents DHKEM(P-256, HKDF-SHA256)

Trait Implementations§

source§

impl Kem for DhP256HkdfSha256

source§

fn derive_keypair(ikm: &[u8]) -> (Self::PrivateKey, Self::PublicKey)

Deterministically derives a keypair from the given input keying material

Requirements

This keying material SHOULD have as many bits of entropy as the bit length of a secret key, i.e., 8 * Self::PrivateKey::size(). For X25519 and P-256, this is 256 bits of entropy.

§

type PublicKey = <DhP256 as DhKeyExchange>::PublicKey

The key exchange’s public key type. If you want to generate a keypair, see Kem::gen_keypair or Kem::derive_keypair
§

type PrivateKey = <DhP256 as DhKeyExchange>::PrivateKey

The key exchange’s private key type. If you want to generate a keypair, see Kem::gen_keypair or Kem::derive_keypair
§

type EncappedKey = EncappedKey

The encapsulated key for this KEM. This is used by the recipient to derive the shared secret.
source§

const KEM_ID: u16 = 16u16

The algorithm identifier for a KEM implementation
source§

fn gen_keypair<R: CryptoRng + RngCore>( csprng: &mut R ) -> (Self::PrivateKey, Self::PublicKey)

Generates a random keypair using the given RNG

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.