Allow SharedSecret to be created from byte array
This was accidentally removed in 8b2edad
. See also the discussion
on https://github.com/rust-bitcoin/rust-secp256k1/pull/402
This commit is contained in:
parent
39e47fb645
commit
9be8e74107
|
@ -71,6 +71,11 @@ impl SharedSecret {
|
||||||
pub fn secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] {
|
pub fn secret_bytes(&self) -> [u8; SHARED_SECRET_SIZE] {
|
||||||
self.0
|
self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Creates a shared secret from a byte serialization.
|
||||||
|
pub fn from_bytes(bytes: [u8; SHARED_SECRET_SIZE]) -> SharedSecret {
|
||||||
|
SharedSecret(bytes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Borrow<[u8]> for SharedSecret {
|
impl Borrow<[u8]> for SharedSecret {
|
||||||
|
|
Loading…
Reference in New Issue