Merge rust-bitcoin/rust-secp256k1#417: Allow SharedSecret to be created from byte array
463148f9a0
bump version to 0.22.1 (Dominik Spicher)9be8e74107
Allow SharedSecret to be created from byte array (Dominik Spicher) Pull request description: This was accidentally removed in8b2edad
. See also the discussion on https://github.com/rust-bitcoin/rust-secp256k1/pull/402 Closes #416. ACKs for top commit: apoelstra: ACK463148f9a0
Tree-SHA512: 04e16226efa2cf6fd461eabb0c78e5b00f347c78e20c1c7561591ffa74a7259fb3265b49a9d7326caf70e4d5ce32a620485f1bd5538c292654f91eb68c2a57dc
This commit is contained in:
commit
330c91b2be
|
@ -1,3 +1,7 @@
|
||||||
|
# 0.22.1 - 2022-03-10
|
||||||
|
|
||||||
|
* [Reintroduce](https://github.com/rust-bitcoin/rust-secp256k1/pull/417) accidentally removed possibility to create `SharedSecret` from byte serialization
|
||||||
|
|
||||||
# 0.22.0 - 2022-03-08
|
# 0.22.0 - 2022-03-08
|
||||||
|
|
||||||
* Disable `bitcoin_hashes/std` by default; [add `bitcoin-hashes-std` feature to re-enable it](https://github.com/rust-bitcoin/rust-secp256k1/pull/410)
|
* Disable `bitcoin_hashes/std` by default; [add `bitcoin-hashes-std` feature to re-enable it](https://github.com/rust-bitcoin/rust-secp256k1/pull/410)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "secp256k1"
|
name = "secp256k1"
|
||||||
version = "0.22.0"
|
version = "0.22.1"
|
||||||
authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>",
|
authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>",
|
||||||
"Andrew Poelstra <apoelstra@wpsoftware.net>" ]
|
"Andrew Poelstra <apoelstra@wpsoftware.net>" ]
|
||||||
license = "CC0-1.0"
|
license = "CC0-1.0"
|
||||||
|
|
|
@ -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