diff options
Diffstat (limited to 'src/kem.rs')
-rw-r--r-- | src/kem.rs | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -69,6 +69,12 @@ impl From<<BonehBoyenGoh as Hibe>::PublicKey> for PublicKey { } } +impl From<PublicKey> for <BonehBoyenGoh as Hibe>::PublicKey { + fn from(value: PublicKey) -> Self { + value.0 + } +} + impl ByteAccess for PublicKey { fn bytes(&self) -> Vec<u8> { bincode::serialize(&self.0).unwrap() @@ -102,6 +108,12 @@ impl From<<BonehBoyenGoh as Hibe>::MasterKey> for MasterKey { } } +impl From<MasterKey> for <BonehBoyenGoh as Hibe>::MasterKey { + fn from(value: MasterKey) -> Self { + value.0 + } +} + impl ByteAccess for MasterKey { fn bytes(&self) -> Vec<u8> { bincode::serialize(&self.0).unwrap() @@ -135,6 +147,12 @@ impl From<<BonehBoyenGoh as Hibe>::PrivateKey> for PrivateKey { } } +impl From<PrivateKey> for <BonehBoyenGoh as Hibe>::PrivateKey { + fn from(value: PrivateKey) -> Self { + value.0 + } +} + impl ByteAccess for PrivateKey { fn bytes(&self) -> Vec<u8> { bincode::serialize(&self.0).unwrap() @@ -169,6 +187,12 @@ impl From<<BonehBoyenGoh as HibeKem>::EncapsulatedKey> for EncapsulatedKey { } } +impl From<EncapsulatedKey> for <BonehBoyenGoh as HibeKem>::EncapsulatedKey { + fn from(value: EncapsulatedKey) -> Self { + value.0 + } +} + impl ByteAccess for EncapsulatedKey { fn bytes(&self) -> Vec<u8> { bincode::serialize(&self.0).unwrap() |