From d37b8a5dd2393399476309193d115fac7a9907c2 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Wed, 9 Oct 2024 15:44:52 +0100 Subject: [PATCH] Fix HashEngine.length name change to bytes_hashed When `hashes_fuzz` is on the field `length` is refered to but it was changed to `bytes_hashed` in a previous PR. This has been fixed by changing `length` to `bytes_hashed`. --- hashes/src/ripemd160.rs | 2 +- hashes/src/util.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hashes/src/ripemd160.rs b/hashes/src/ripemd160.rs index 90d200e76..d627e2c34 100644 --- a/hashes/src/ripemd160.rs +++ b/hashes/src/ripemd160.rs @@ -37,7 +37,7 @@ fn from_engine(mut e: HashEngine) -> Hash { #[cfg(hashes_fuzz)] fn from_engine(e: HashEngine) -> Hash { let mut res = e.midstate(); - res[0] ^= (e.length & 0xff) as u8; + res[0] ^= (e.bytes_hashed & 0xff) as u8; Hash(res) } diff --git a/hashes/src/util.rs b/hashes/src/util.rs index cb71a42c3..0d2b8cb2b 100644 --- a/hashes/src/util.rs +++ b/hashes/src/util.rs @@ -91,7 +91,7 @@ macro_rules! engine_input_impl( for c in inp { self.buffer[0] ^= *c; } - self.length += inp.len(); + self.bytes_hashed += inp.len(); } ) );