rozbb / rust-hpke

An implementation of the HPKE hybrid encryption standard (RFC 9180)
Other
62 stars 31 forks source link

kem::encap_with_eph parameters disambiguition #24

Closed BoOTheFurious closed 2 years ago

BoOTheFurious commented 2 years ago

Hello,

What is the purpose of the sk_eph: Self::PrivateKey parameter in the kem::encap_with_eph function. The name suggest it is the ephemeral secret but it's the role of this function to generate it and it is not coherent with the type. This parameters seems to be useless. Is there something I did not understand ?

Regards

rozbb commented 2 years ago

encap_with_eph doesn't generate its own ephemeral secret, in fact, it doesn't even take an RNG as input. Generating sk_eph is the job of encap. I split out the functionality because 1) it's slightly easier this way and 2) I need encap_with_eph for running test vectors.

rozbb commented 2 years ago

Fixed in #27