Skip to content

Commit 91ce8ce

Browse files
committed
Add benchmark for MuHash finalization
1 parent 66aa6a4 commit 91ce8ce

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/bench/crypto_hash.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,19 @@ static void MuHashPrecompute(benchmark::Bench& bench)
249249
});
250250
}
251251

252+
static void MuHashFinalize(benchmark::Bench& bench)
253+
{
254+
FastRandomContext rng(true);
255+
MuHash3072 acc{rng.randbytes(32)};
256+
acc /= MuHash3072{rng.rand256()};
257+
258+
bench.run([&] {
259+
uint256 out;
260+
acc.Finalize(out);
261+
acc /= MuHash3072{out};
262+
});
263+
}
264+
252265
BENCHMARK(BenchRIPEMD160, benchmark::PriorityLevel::HIGH);
253266
BENCHMARK(SHA1, benchmark::PriorityLevel::HIGH);
254267
BENCHMARK(SHA256_STANDARD, benchmark::PriorityLevel::HIGH);
@@ -272,3 +285,4 @@ BENCHMARK(MuHash, benchmark::PriorityLevel::HIGH);
272285
BENCHMARK(MuHashMul, benchmark::PriorityLevel::HIGH);
273286
BENCHMARK(MuHashDiv, benchmark::PriorityLevel::HIGH);
274287
BENCHMARK(MuHashPrecompute, benchmark::PriorityLevel::HIGH);
288+
BENCHMARK(MuHashFinalize, benchmark::PriorityLevel::HIGH);

0 commit comments

Comments
 (0)