diff --git a/CHANGELOG.md b/CHANGELOG.md index b060d8a..d82f419 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.27.0 - 2023-13-15 + +* [Depend on newly release `bitcoin_hashes` v0.12](https://github.com/rust-bitcoin/rust-secp256k1/pull/588). +* [Implement `Debug` trait for `Scalar` type](https://github.com/rust-bitcoin/rust-secp256k1/pull/578). +* [Implement `insecure-erase`](https://github.com/rust-bitcoin/rust-secp256k1/pull/582). + # 0.26.0 - 2202-12-19 * Update libsecp25k1 to v0.2.0 diff --git a/Cargo.toml b/Cargo.toml index 0420855..9d24b50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "secp256k1" -version = "0.26.0" +version = "0.27.0" authors = [ "Dawid Ciężarkiewicz ", "Andrew Poelstra " ] license = "CC0-1.0" @@ -42,7 +42,7 @@ serde = { version = "1.0", default-features = false, optional = true } # You likely only want to enable these if you explicitly do not want to use "std", otherwise enable # the respective -std feature e.g., bitcoin-hashes-std -bitcoin_hashes = { version = "0.11", default-features = false, optional = true } +bitcoin_hashes = { version = "0.12", default-features = false, optional = true } rand = { version = "0.8", default-features = false, optional = true } [dev-dependencies] diff --git a/examples/sign_verify.rs b/examples/sign_verify.rs index 1ed13fa..081d1b0 100644 --- a/examples/sign_verify.rs +++ b/examples/sign_verify.rs @@ -11,7 +11,7 @@ fn verify( pubkey: [u8; 33], ) -> Result { let msg = sha256::Hash::hash(msg); - let msg = Message::from_slice(&msg)?; + let msg = Message::from_slice(msg.as_ref())?; let sig = ecdsa::Signature::from_compact(&sig)?; let pubkey = PublicKey::from_slice(&pubkey)?; @@ -24,7 +24,7 @@ fn sign( seckey: [u8; 32], ) -> Result { let msg = sha256::Hash::hash(msg); - let msg = Message::from_slice(&msg)?; + let msg = Message::from_slice(msg.as_ref())?; let seckey = SecretKey::from_slice(&seckey)?; Ok(secp.sign_ecdsa(&msg, &seckey)) } diff --git a/examples/sign_verify_recovery.rs b/examples/sign_verify_recovery.rs index 9312ec2..edcc7b3 100644 --- a/examples/sign_verify_recovery.rs +++ b/examples/sign_verify_recovery.rs @@ -11,7 +11,7 @@ fn recover( recovery_id: u8, ) -> Result { let msg = sha256::Hash::hash(msg); - let msg = Message::from_slice(&msg)?; + let msg = Message::from_slice(msg.as_ref())?; let id = ecdsa::RecoveryId::from_i32(recovery_id as i32)?; let sig = ecdsa::RecoverableSignature::from_compact(&sig, id)?; @@ -24,7 +24,7 @@ fn sign_recovery( seckey: [u8; 32], ) -> Result { let msg = sha256::Hash::hash(msg); - let msg = Message::from_slice(&msg)?; + let msg = Message::from_slice(msg.as_ref())?; let seckey = SecretKey::from_slice(&seckey)?; Ok(secp.sign_ecdsa_recoverable(&msg, &seckey)) } diff --git a/src/ecdh.rs b/src/ecdh.rs index fdf5a16..0f36772 100644 --- a/src/ecdh.rs +++ b/src/ecdh.rs @@ -260,7 +260,7 @@ mod tests { engine.input(&xy.as_ref()[..32]); let secret_bh = sha256::Hash::from_engine(engine); - assert_eq!(secret_bh.as_inner(), secret_sys.as_ref()); + assert_eq!(secret_bh.as_byte_array(), secret_sys.as_ref()); } #[test] diff --git a/src/lib.rs b/src/lib.rs index 22e879e..9abcf39 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -216,19 +216,19 @@ pub trait ThirtyTwoByteHash { #[cfg(feature = "bitcoin_hashes")] #[cfg_attr(docsrs, doc(cfg(feature = "bitcoin-hashes")))] impl ThirtyTwoByteHash for hashes::sha256::Hash { - fn into_32(self) -> [u8; 32] { self.into_inner() } + fn into_32(self) -> [u8; 32] { self.to_byte_array() } } #[cfg(feature = "bitcoin_hashes")] #[cfg_attr(docsrs, doc(cfg(feature = "bitcoin-hashes")))] impl ThirtyTwoByteHash for hashes::sha256d::Hash { - fn into_32(self) -> [u8; 32] { self.into_inner() } + fn into_32(self) -> [u8; 32] { self.to_byte_array() } } #[cfg(feature = "bitcoin_hashes")] #[cfg_attr(docsrs, doc(cfg(feature = "bitcoin-hashes")))] impl ThirtyTwoByteHash for hashes::sha256t::Hash { - fn into_32(self) -> [u8; 32] { self.into_inner() } + fn into_32(self) -> [u8; 32] { self.to_byte_array() } } /// A (hashed) message input to an ECDSA signature. @@ -1046,12 +1046,12 @@ mod tests { let hash = hashes::sha256::Hash::hash(test_bytes); let msg = Message::from(hash); - assert_eq!(msg.0, hash.into_inner()); + assert_eq!(msg.0, hash.to_byte_array()); assert_eq!(msg, Message::from_hashed_data::(test_bytes)); let hash = hashes::sha256d::Hash::hash(test_bytes); let msg = Message::from(hash); - assert_eq!(msg.0, hash.into_inner()); + assert_eq!(msg.0, hash.to_byte_array()); assert_eq!(msg, Message::from_hashed_data::(test_bytes)); } }