Merge rust-bitcoin/rust-bitcoin#4015: hashes: Derive `Debug` for all hash engines

6263b9c6af hashes: Derive Debug for all hash engines (Tobin C. Harding)

Pull request description:

  Public types typically should implement `Debug`.

  Derive `Debug` for all the hash engines.

ACKs for top commit:
  Kixunil:
    ACK 6263b9c6af
  apoelstra:
    ACK 6263b9c6afc377822d0cefb1303e98ea51f1a5b6; successfully ran local tests

Tree-SHA512: c50b7b23229c6b4bc05754142bdcc1669393dd11a7eec829f9f950d75209468693e4977582e356e2b2db6a445d22071c6e60cb6a778ab8fff705e71e680b3c8c
This commit is contained in:
merge-script 2025-02-07 23:57:31 +00:00
commit 8464b1452f
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
9 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,7 @@ fn from_engine(e: HashEngine) -> Hash {
}
/// Engine to compute HASH160 hash function.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine(sha256::HashEngine);
impl HashEngine {

View File

@ -35,7 +35,7 @@ impl<T: GeneralHash + str::FromStr> str::FromStr for Hmac<T> {
}
/// Pair of underlying hash engines, used for the inner and outer hash of HMAC.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HmacEngine<T: GeneralHash> {
iengine: T::Engine,
oengine: T::Engine,

View File

@ -48,7 +48,7 @@ fn from_engine(e: HashEngine) -> Hash {
const BLOCK_SIZE: usize = 64;
/// Engine to compute RIPEMD160 hash function.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine {
buffer: [u8; BLOCK_SIZE],
h: [u32; 5],

View File

@ -40,7 +40,7 @@ fn from_engine(mut e: HashEngine) -> Hash {
const BLOCK_SIZE: usize = 64;
/// Engine to compute SHA1 hash function.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine {
buffer: [u8; BLOCK_SIZE],
h: [u32; 5],

View File

@ -54,7 +54,7 @@ fn from_engine(e: HashEngine) -> Hash {
const BLOCK_SIZE: usize = 64;
/// Engine to compute SHA256 hash function.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine {
buffer: [u8; BLOCK_SIZE],
h: [u32; 8],

View File

@ -20,7 +20,7 @@ fn from_engine(e: HashEngine) -> Hash {
}
/// Engine to compute SHA256d hash function.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine(sha256::HashEngine);
impl HashEngine {

View File

@ -17,7 +17,7 @@ fn from_engine(e: HashEngine) -> Hash {
}
/// Engine to compute SHA384 hash function.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine(sha512::HashEngine);
impl HashEngine {

View File

@ -49,7 +49,7 @@ pub(crate) fn from_engine(e: HashEngine) -> Hash {
pub(crate) const BLOCK_SIZE: usize = 128;
/// Engine to compute SHA512 hash function.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine {
h: [u64; 8],
bytes_hashed: u64,

View File

@ -27,7 +27,7 @@ fn from_engine(e: HashEngine) -> Hash {
/// the output to 256 bits. It has different initial constants than sha512 so it
/// produces an entirely different hash compared to sha512. More information at
/// <https://eprint.iacr.org/2010/548.pdf>.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct HashEngine(sha512::HashEngine);
impl HashEngine {