diff --git a/ml-kem/src/kem.rs b/ml-kem/src/kem.rs index 4abc52a..c8bfcb1 100644 --- a/ml-kem/src/kem.rs +++ b/ml-kem/src/kem.rs @@ -18,12 +18,17 @@ pub use ::kem::{Decapsulate, Encapsulate}; /// A shared key resulting from an ML-KEM transaction pub(crate) type SharedKey = B32; +/// Derived parameters relevant to ML-KEM +pub trait Params: KemParams {} + +impl Params for K {} + /// A `DecapsulationKey` provides the ability to generate a new key pair, and decapsulate an /// encapsulated shared key. #[derive(Clone, Debug, PartialEq)] pub struct DecapsulationKey

where - P: KemParams, + P: Params, { dk_pke: DecryptionKey

, ek: EncapsulationKey

, @@ -147,7 +152,7 @@ where #[derive(Clone, Debug, PartialEq)] pub struct EncapsulationKey

where - P: KemParams, + P: Params, { ek_pke: EncryptionKey

, h: B32, @@ -218,7 +223,7 @@ where /// together all of the other related types and sizes. pub struct Kem

where - P: KemParams, + P: Params, { _phantom: PhantomData

, } @@ -258,7 +263,7 @@ mod test { fn round_trip_test

() where - P: KemParams, + P: Params, { let mut rng = rand::thread_rng(); @@ -279,7 +284,7 @@ mod test { fn codec_test

() where - P: KemParams, + P: Params, { let mut rng = rand::thread_rng(); let dk_original = DecapsulationKey::

::generate(&mut rng);