Hello,
In the kem trait, the function gen_keypair is usually derived from derive_keypair. Thus a default implementation will ease the implementation of the kem trait.
fn gen_keypair<R: rand::CryptoRng + rand::RngCore>(
csprng: &mut R,
) -> (Self::PrivateKey, Self::PublicKey) {
// Make some keying material that's the size of a private key
let mut ikm: GenericArray<u8, <Self::PrivateKey as hpke::Serializable>::OutputSize> =
GenericArray::default();
// Fill it with randomness
csprng.fill_bytes(&mut ikm);
// Run derive_keypair using the KEM's KDF
Self::derive_keypair(&ikm)
}
Hello, In the
kem
trait, the functiongen_keypair
is usually derived fromderive_keypair
. Thus a default implementation will ease the implementation of thekem
trait.(I can make a PR if it is easier for you)
Regards,