Skip to content

Commit

Permalink
Remove impls of ThirtyTwoByteHash for hashes types
Browse files Browse the repository at this point in the history
These impls make using secp with hashes and bitcoin difficult during
upgrade, or if different versions of the libs get pulled in for any
reason. Since we do not use these impls in `rust-bitcoin` (we implement
the trait manually for sighash types) lets just remove them for now.

Note the implementations were a previous attempt at fixing this problem,
we refereed to it as the "dependency hole" because secp the repository
is outside of `rust-bitcoin` repo but `hashes` and `bitcoin` are in it.

Close: #673
  • Loading branch information
tcharding committed Mar 26, 2024
1 parent fb676dc commit 63e737f
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,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<T: hashes::sha256t::Tag> ThirtyTwoByteHash for hashes::sha256t::Hash<T> {
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]);
Expand Down

0 comments on commit 63e737f

Please sign in to comment.