25 bench.batch(
in.size()).unit(
"byte").run(
32 bench.batch(
in.size()).unit(
"byte").run(
39 bench.batch(
in.size()).unit(
"byte").run(
46 bench.batch(
in.size()).unit(
"byte").run(
51 std::vector<uint8_t>
in(32, 0);
52 bench.batch(
in.size()).unit(
"byte").run(
57 std::vector<uint8_t>
in(64 * 1024, 0);
58 bench.batch(
in.size()).unit(
"byte").run(
65 bench.batch(
in.size()).unit(
"byte").run(
117 std::vector<uint8_t> key{rng.
randbytes(32)};
static const uint8_t k1[32]
A hasher class for RIPEMD-160.
CRIPEMD160 & Write(const uint8_t *data, size_t len)
void Finalize(uint8_t hash[OUTPUT_SIZE])
static const size_t OUTPUT_SIZE
void Finalize(uint8_t hash[OUTPUT_SIZE])
CSHA1 & Write(const uint8_t *data, size_t len)
static const size_t OUTPUT_SIZE
A hasher class for SHA-256.
CSHA256 & Write(const uint8_t *data, size_t len)
static const size_t OUTPUT_SIZE
void Finalize(uint8_t hash[OUTPUT_SIZE])
A hasher class for SHA-512.
CSHA512 & Write(const uint8_t *data, size_t len)
static constexpr size_t OUTPUT_SIZE
void Finalize(uint8_t hash[OUTPUT_SIZE])
uint32_t rand32() noexcept
Generate a random 32-bit integer.
std::vector< uint8_t > randbytes(size_t len)
Generate random bytes.
bool randbool() noexcept
Generate a random boolean.
A class representing MuHash sets.
SHA3_256 & Finalize(Span< uint8_t > output)
SHA3_256 & Write(Span< const uint8_t > data)
static constexpr size_t OUTPUT_SIZE
Main entry point to nanobench's benchmarking facility.
static void RIPEMD160(benchmark::Bench &bench)
static void SipHash_32b(benchmark::Bench &bench)
static void FastRandom_1bit(benchmark::Bench &bench)
static void MuHashPrecompute(benchmark::Bench &bench)
static const uint64_t BUFFER_SIZE
static void SHA256_32b(benchmark::Bench &bench)
static void FastRandom_32bit(benchmark::Bench &bench)
static void MuHashMul(benchmark::Bench &bench)
static void SHA256D64_1024(benchmark::Bench &bench)
static void SHA3_256_1M(benchmark::Bench &bench)
static void SHA1(benchmark::Bench &bench)
static void SHA512(benchmark::Bench &bench)
static void SHA256(benchmark::Bench &bench)
static void MuHashDiv(benchmark::Bench &bench)
static void MuHash(benchmark::Bench &bench)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
void SHA256D64(uint8_t *out, const uint8_t *in, size_t blocks)
Compute multiple double-SHA256's of 64-byte blobs.
uint64_t SipHashUint256(uint64_t k0, uint64_t k1, const uint256 &val)
Optimized SipHash-2-4 implementation for uint256.