diff --git a/x-wing/src/lib.rs b/x-wing/src/lib.rs index 98b2220..ccece62 100644 --- a/x-wing/src/lib.rs +++ b/x-wing/src/lib.rs @@ -242,13 +242,19 @@ impl KeySizeUser for DecapsulationKey { } impl KeyInit for DecapsulationKey { - fn new(key: &ArrayN) -> Self { + fn new(key: &Key) -> Self { let (_sk_m, _sk_x, pk_m, pk_x) = expand_key(key.as_ref()); let ek = EncapsulationKey { pk_m, pk_x }; Self { sk: key.0, ek } } } +impl KeyExport for DecapsulationKey { + fn to_bytes(&self) -> Key { + self.sk.into() + } +} + #[cfg(feature = "zeroize")] impl ZeroizeOnDrop for DecapsulationKey {}