[−][src]Trait hpke::Kem
Defines a combination of key exchange mechanism and a KDF, which together form a KEM
Associated Types
type Kex: KeyExchange
Associated Constants
Loading content...Provided methods
fn derive_keypair(
ikm: &[u8]
) -> (<Self::Kex as KeyExchange>::PrivateKey, <Self::Kex as KeyExchange>::PublicKey)
ikm: &[u8]
) -> (<Self::Kex as KeyExchange>::PrivateKey, <Self::Kex as KeyExchange>::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::Kex::PrivateKey::size()
. For X25519 and P-256, this is 32 bytes of
entropy.
fn gen_keypair<R: CryptoRng + RngCore>(
csprng: &mut R
) -> (<Self::Kex as KeyExchange>::PrivateKey, <Self::Kex as KeyExchange>::PublicKey)
csprng: &mut R
) -> (<Self::Kex as KeyExchange>::PrivateKey, <Self::Kex as KeyExchange>::PublicKey)
Generates a random keypair using the given RNG