aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bench/crypto_hash.cpp4
-rw-r--r--src/bench/rollingbloom.cpp16
2 files changed, 10 insertions, 10 deletions
diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp
index 7d5e3ca4ee..d36e504bfc 100644
--- a/src/bench/crypto_hash.cpp
+++ b/src/bench/crypto_hash.cpp
@@ -110,9 +110,9 @@ static void MuHash(benchmark::Bench& bench)
{
MuHash3072 acc;
unsigned char key[32] = {0};
- int i = 0;
+ uint32_t i = 0;
bench.run([&] {
- key[0] = ++i;
+ key[0] = ++i & 0xFF;
acc *= MuHash3072(key);
});
}
diff --git a/src/bench/rollingbloom.cpp b/src/bench/rollingbloom.cpp
index 997ab56549..28167767db 100644
--- a/src/bench/rollingbloom.cpp
+++ b/src/bench/rollingbloom.cpp
@@ -13,16 +13,16 @@ static void RollingBloom(benchmark::Bench& bench)
uint32_t count = 0;
bench.run([&] {
count++;
- data[0] = count;
- data[1] = count >> 8;
- data[2] = count >> 16;
- data[3] = count >> 24;
+ data[0] = count & 0xFF;
+ data[1] = (count >> 8) & 0xFF;
+ data[2] = (count >> 16) & 0xFF;
+ data[3] = (count >> 24) & 0xFF;
filter.insert(data);
- data[0] = count >> 24;
- data[1] = count >> 16;
- data[2] = count >> 8;
- data[3] = count;
+ data[0] = (count >> 24) & 0xFF;
+ data[1] = (count >> 16) & 0xFF;
+ data[2] = (count >> 8) & 0xFF;
+ data[3] = count & 0xFF;
filter.contains(data);
});
}