Skip to content

Commit 9be8e74

Browse files
committed
Allow SharedSecret to be created from byte array
This was accidentally removed in 8b2edad. See also the discussion on #402
1 parent 39e47fb commit 9be8e74

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ecdh.rs

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ impl SharedSecret {
7171
pub fn secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] {
7272
self.0
7373
}
74+
75+
/// Creates a shared secret from a byte serialization.
76+
pub fn from_bytes(bytes: [u8; SHARED_SECRET_SIZE]) -> SharedSecret {
77+
SharedSecret(bytes)
78+
}
7479
}
7580

7681
impl Borrow<[u8]> for SharedSecret {

0 commit comments

Comments
 (0)