diff --git a/src/lib.rs b/src/lib.rs index 9a092b526..ddc36a632 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -176,8 +176,6 @@ use core::{fmt, mem, str}; #[cfg(feature = "global-context")] pub use context::global::SECP256K1; -#[cfg(feature = "hashes")] -use hashes::Hash; #[cfg(feature = "rand")] pub use rand; pub use secp256k1_sys as ffi; @@ -198,21 +196,6 @@ pub trait ThirtyTwoByteHash { fn into_32(self) -> [u8; 32]; } -#[cfg(feature = "hashes")] -impl ThirtyTwoByteHash for hashes::sha256::Hash { - fn into_32(self) -> [u8; 32] { self.to_byte_array() } -} - -#[cfg(feature = "hashes")] -impl ThirtyTwoByteHash for hashes::sha256d::Hash { - fn into_32(self) -> [u8; 32] { self.to_byte_array() } -} - -#[cfg(feature = "hashes")] -impl ThirtyTwoByteHash for hashes::sha256t::Hash { - fn into_32(self) -> [u8; 32] { self.to_byte_array() } -} - /// A (hashed) message input to an ECDSA signature. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Message([u8; constants::MESSAGE_SIZE]); @@ -1038,24 +1021,6 @@ mod tests { let sig = SECP256K1.sign_ecdsa(&msg, &sk); assert!(SECP256K1.verify_ecdsa(&msg, &sig, &pk).is_ok()); } - - #[cfg(feature = "hashes")] - #[test] - fn test_from_hash() { - use hashes::{sha256, sha256d, Hash}; - - let test_bytes = "Hello world!".as_bytes(); - - let hash = sha256::Hash::hash(test_bytes); - let msg = Message::from(hash); - assert_eq!(msg.0, hash.to_byte_array()); - assert_eq!(msg, Message::from_hashed_data::(test_bytes)); - - let hash = sha256d::Hash::hash(test_bytes); - let msg = Message::from(hash); - assert_eq!(msg.0, hash.to_byte_array()); - assert_eq!(msg, Message::from_hashed_data::(test_bytes)); - } } #[cfg(bench)]