mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 12:52:35 -03:00
Add SHA3 benchmark
This commit is contained in:
parent
2ac8bf9583
commit
3f01ddb01b
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <crypto/ripemd160.h>
|
#include <crypto/ripemd160.h>
|
||||||
#include <crypto/sha1.h>
|
#include <crypto/sha1.h>
|
||||||
#include <crypto/sha256.h>
|
#include <crypto/sha256.h>
|
||||||
|
#include <crypto/sha3.h>
|
||||||
#include <crypto/sha512.h>
|
#include <crypto/sha512.h>
|
||||||
#include <crypto/siphash.h>
|
#include <crypto/siphash.h>
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
|
@ -43,6 +44,15 @@ static void SHA256(benchmark::Bench& bench)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void SHA3_256_1M(benchmark::Bench& bench)
|
||||||
|
{
|
||||||
|
uint8_t hash[SHA3_256::OUTPUT_SIZE];
|
||||||
|
std::vector<uint8_t> in(BUFFER_SIZE,0);
|
||||||
|
bench.batch(in.size()).unit("byte").run([&] {
|
||||||
|
SHA3_256().Write(in).Finalize(hash);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
static void SHA256_32b(benchmark::Bench& bench)
|
static void SHA256_32b(benchmark::Bench& bench)
|
||||||
{
|
{
|
||||||
std::vector<uint8_t> in(32,0);
|
std::vector<uint8_t> in(32,0);
|
||||||
|
@ -99,6 +109,7 @@ BENCHMARK(RIPEMD160);
|
||||||
BENCHMARK(SHA1);
|
BENCHMARK(SHA1);
|
||||||
BENCHMARK(SHA256);
|
BENCHMARK(SHA256);
|
||||||
BENCHMARK(SHA512);
|
BENCHMARK(SHA512);
|
||||||
|
BENCHMARK(SHA3_256_1M);
|
||||||
|
|
||||||
BENCHMARK(SHA256_32b);
|
BENCHMARK(SHA256_32b);
|
||||||
BENCHMARK(SipHash_32b);
|
BENCHMARK(SipHash_32b);
|
||||||
|
|
Loading…
Reference in a new issue