Struct hpke::kem::X25519HkdfSha256
source · pub struct X25519HkdfSha256;
Expand description
Represents DHKEM(X25519, HKDF-SHA256)
Trait Implementations§
source§impl Kem for X25519HkdfSha256
impl Kem for X25519HkdfSha256
source§fn derive_keypair(ikm: &[u8]) -> (Self::PrivateKey, Self::PublicKey)
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 = <X25519 as DhKeyExchange>::PublicKey
type PublicKey = <X25519 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 = <X25519 as DhKeyExchange>::PrivateKey
type PrivateKey = <X25519 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
type EncappedKey = EncappedKey
The encapsulated key for this KEM. This is used by the recipient to derive the shared
secret.
source§fn gen_keypair<R: CryptoRng + RngCore>(
csprng: &mut R
) -> (Self::PrivateKey, Self::PublicKey)
fn gen_keypair<R: CryptoRng + RngCore>( csprng: &mut R ) -> (Self::PrivateKey, Self::PublicKey)
Generates a random keypair using the given RNG
Auto Trait Implementations§
impl RefUnwindSafe for X25519HkdfSha256
impl Send for X25519HkdfSha256
impl Sync for X25519HkdfSha256
impl Unpin for X25519HkdfSha256
impl UnwindSafe for X25519HkdfSha256
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more