We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
KeyExport
DecapsulationKey
1 parent 569e43f commit 5e7c1bbCopy full SHA for 5e7c1bb
x-wing/src/lib.rs
@@ -242,13 +242,19 @@ impl KeySizeUser for DecapsulationKey {
242
}
243
244
impl KeyInit for DecapsulationKey {
245
- fn new(key: &ArrayN<u8, 32>) -> Self {
+ fn new(key: &Key<Self>) -> Self {
246
let (_sk_m, _sk_x, pk_m, pk_x) = expand_key(key.as_ref());
247
let ek = EncapsulationKey { pk_m, pk_x };
248
Self { sk: key.0, ek }
249
250
251
252
+impl KeyExport for DecapsulationKey {
253
+ fn to_bytes(&self) -> Key<Self> {
254
+ self.sk.into()
255
+ }
256
+}
257
+
258
#[cfg(feature = "zeroize")]
259
impl ZeroizeOnDrop for DecapsulationKey {}
260
0 commit comments