Struct hpke::kem::DhP256HkdfSha256
source · pub struct DhP256HkdfSha256;
Expand description
Represents DHKEM(P-256, HKDF-SHA256)
Trait Implementations§
source§impl Kem for DhP256HkdfSha256
impl Kem for DhP256HkdfSha256
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 = <DhP256 as DhKeyExchange>::PublicKey
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
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
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 DhP256HkdfSha256
impl Send for DhP256HkdfSha256
impl Sync for DhP256HkdfSha256
impl Unpin for DhP256HkdfSha256
impl UnwindSafe for DhP256HkdfSha256
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