diff --git a/ml-kem/src/kem.rs b/ml-kem/src/kem.rs index 2ac2566..8485d64 100644 --- a/ml-kem/src/kem.rs +++ b/ml-kem/src/kem.rs @@ -100,16 +100,17 @@ impl

DecapsulationKey

where P: KemParams, { + /// Get the [`EncapsulationKey`] which corresponds to this [`DecapsulationKey`]. + pub fn encapsulation_key(&self) -> &EncapsulationKey

{ + &self.ek + } + pub(crate) fn generate(rng: &mut impl CryptoRngCore) -> Self { let d: B32 = rand(rng); let z: B32 = rand(rng); Self::generate_deterministic(&d, &z) } - pub(crate) fn encapsulation_key(&self) -> &EncapsulationKey

{ - &self.ek - } - #[must_use] #[allow(clippy::similar_names)] // allow dk_pke, ek_pke, following the spec pub(crate) fn generate_deterministic(d: &B32, z: &B32) -> Self {