aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kem.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/kem.rs b/src/kem.rs
index 091247d..a97d34f 100644
--- a/src/kem.rs
+++ b/src/kem.rs
@@ -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()