diff options
author | Andreas Grois <andi@grois.info> | 2022-10-23 15:51:30 +0200 |
---|---|---|
committer | Andreas Grois <andi@grois.info> | 2022-10-23 15:51:30 +0200 |
commit | cb219708923df26e0efc0ce172e1be7414287fe2 (patch) | |
tree | 7d4b8e42df9a6f2847687247fdb2bc4b6b2dad29 /benches | |
parent | e17a38b1c44215911c1a84d94413e7f486edcaa3 (diff) |
Fix benchmark errors.
20 bytes worst case was using 16 bytes.
32 bytes full division was producing a leading zero.
Diffstat (limited to 'benches')
-rw-r--r-- | benches/hashrate_20.rs | 2 | ||||
-rw-r--r-- | benches/mock_hashers/mod.rs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/benches/hashrate_20.rs b/benches/hashrate_20.rs index 3999380..b661df7 100644 --- a/benches/hashrate_20.rs +++ b/benches/hashrate_20.rs @@ -46,7 +46,7 @@ fn criterion_bench_20bytes_full_divide(c: &mut Criterion) { fn criterion_bench_20bytes_worst_case(c: &mut Criterion) { let pwm = Pwm::new( - HashAlgorithm::Md5, + HashAlgorithm::Ripemd160, passwordmaker_rs::UseLeetWhenGenerating::NotAtAll, "XY", "", diff --git a/benches/mock_hashers/mod.rs b/benches/mock_hashers/mod.rs index 29e91b9..5eb9ea7 100644 --- a/benches/mock_hashers/mod.rs +++ b/benches/mock_hashers/mod.rs @@ -13,31 +13,31 @@ pub(crate) struct MockRipeMD160; impl Hasher for MockMd4{ type Output = [u8;16]; fn hash(_data : &[u8]) -> Self::Output { - black_box([156u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8]) + black_box([219u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8]) } } impl Hasher for MockMd5{ type Output = [u8;16]; fn hash(_data : &[u8]) -> Self::Output { - black_box([156u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8]) + black_box([219u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8]) } } impl Hasher for MockSha1{ type Output = [u8;20]; fn hash(_data : &[u8]) -> Self::Output { - black_box([156u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8,46,49,13,24]) + black_box([219u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8,46,49,13,24]) } } impl Hasher for MockSha256{ type Output = [u8;32]; fn hash(_data : &[u8]) -> Self::Output { - black_box([156u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8,156u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8]) + black_box([219u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8,156u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8]) } } impl Hasher for MockRipeMD160{ type Output = [u8;20]; fn hash(_data : &[u8]) -> Self::Output { - black_box([156u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8,46,49,13,24]) + black_box([219u8,4u8,123u8,54u8,91u8,85u8,34u8,159u8,243u8,210u8,35u8,41u8,31u8,34u8,75u8,94u8,46,49,13,24]) } } |