From d9129a4840284e93bf1f070e07e55d3e5fc4bea1 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sat, 31 Jan 2026 08:57:39 -0700 Subject: [PATCH] x-wing: impl `KeyExport` for `DecapsulationKey` --- x-wing/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 {}