We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39e47fb commit 6b2c4d4Copy full SHA for 6b2c4d4
src/ecdh.rs
@@ -47,6 +47,14 @@ const SHARED_SECRET_SIZE: usize = constants::SECRET_KEY_SIZE;
47
pub struct SharedSecret([u8; SHARED_SECRET_SIZE]);
48
impl_display_secret!(SharedSecret);
49
50
+impl From<[u8; SHARED_SECRET_SIZE]> for SharedSecret {
51
+ fn from(arr: [u8; SHARED_SECRET_SIZE]) -> Self {
52
+ let mut data = [0u8; SHARED_SECRET_SIZE];
53
+ data[..SHARED_SECRET_SIZE].copy_from_slice(&arr);
54
+ Self(data)
55
+ }
56
+}
57
+
58
impl SharedSecret {
59
/// Creates a new shared secret from a pubkey and secret key.
60
#[inline]
0 commit comments