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`.
This commit is contained in:
Jamil Lambert, PhD 2024-10-09 15:44:52 +01:00
parent 78bcca71ca
commit d37b8a5dd2
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ fn from_engine(mut e: HashEngine) -> Hash {
#[cfg(hashes_fuzz)] #[cfg(hashes_fuzz)]
fn from_engine(e: HashEngine) -> Hash { fn from_engine(e: HashEngine) -> Hash {
let mut res = e.midstate(); let mut res = e.midstate();
res[0] ^= (e.length & 0xff) as u8; res[0] ^= (e.bytes_hashed & 0xff) as u8;
Hash(res) Hash(res)
} }

View File

@ -91,7 +91,7 @@ macro_rules! engine_input_impl(
for c in inp { for c in inp {
self.buffer[0] ^= *c; self.buffer[0] ^= *c;
} }
self.length += inp.len(); self.bytes_hashed += inp.len();
} }
) )
); );