99 std::vector<uint8_t> in(32,0);
102 .
Write(in.data(), in.size())
111 std::vector<uint8_t> in(32,0);
114 .
Write(in.data(), in.size())
123 std::vector<uint8_t> in(32,0);
126 .
Write(in.data(), in.size())
135 std::vector<uint8_t> in(32,0);
138 .
Write(in.data(), in.size())
147 std::vector<uint8_t> in(64 * 1024, 0);
157 std::vector<uint8_t> in(64 * 1024, 0);
167 std::vector<uint8_t> in(64 * 1024, 0);
177 std::vector<uint8_t> in(64 * 1024, 0);
196 auto k0{rng.
rand64()}, k1{rng.rand64()};
197 auto val{rng.rand256()};
211 unsigned char key[32] = {0};
245 std::vector<unsigned char> key{rng.
randbytes(32)};
A hasher class for RIPEMD-160.
CRIPEMD160 & Write(const unsigned char *data, size_t len)
void Finalize(unsigned char hash[OUTPUT_SIZE])
static const size_t OUTPUT_SIZE
CSHA1 & Write(const unsigned char *data, size_t len)
static const size_t OUTPUT_SIZE
void Finalize(unsigned char hash[OUTPUT_SIZE])
A hasher class for SHA-256.
static const size_t OUTPUT_SIZE
void Finalize(unsigned char hash[OUTPUT_SIZE])
CSHA256 & Write(const unsigned char *data, size_t len)
A hasher class for SHA-512.
static constexpr size_t OUTPUT_SIZE
void Finalize(unsigned char hash[OUTPUT_SIZE])
CSHA512 & Write(const unsigned char *data, size_t len)
uint64_t rand64() noexcept
Generate a random 64-bit integer.
A class representing MuHash sets.
std::vector< B > randbytes(size_t len) noexcept
Generate random bytes.
SHA3_256 & Write(Span< const unsigned char > data)
SHA3_256 & Finalize(Span< unsigned char > output)
static constexpr size_t OUTPUT_SIZE
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
ANKERL_NANOBENCH(NODISCARD) std Bench & name(char const *benchmarkName)
Gets the title of the benchmark.
Bench & batch(T b) noexcept
Sets the batch size.
Bench & unit(char const *unit)
Sets the operation unit.
static constexpr unsigned int size()
static void SipHash_32b(benchmark::Bench &bench)
static void SHA256_STANDARD(benchmark::Bench &bench)
static void SHA256_SHANI(benchmark::Bench &bench)
static void MuHashPrecompute(benchmark::Bench &bench)
static const uint64_t BUFFER_SIZE
BENCHMARK(BenchRIPEMD160, benchmark::PriorityLevel::HIGH)
static void SHA256_32b_AVX2(benchmark::Bench &bench)
static void SHA256D64_1024_SHANI(benchmark::Bench &bench)
static void SHA256_AVX2(benchmark::Bench &bench)
static void SHA256_32b_SHANI(benchmark::Bench &bench)
static void SHA256_32b_SSE4(benchmark::Bench &bench)
static void SHA256D64_1024_AVX2(benchmark::Bench &bench)
static void SHA256D64_1024_STANDARD(benchmark::Bench &bench)
static void MuHashMul(benchmark::Bench &bench)
static void SHA256_SSE4(benchmark::Bench &bench)
static void BenchRIPEMD160(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 MuHashDiv(benchmark::Bench &bench)
static void MuHash(benchmark::Bench &bench)
static void SHA256D64_1024_SSE4(benchmark::Bench &bench)
static void SHA256_32b_STANDARD(benchmark::Bench &bench)
void doNotOptimizeAway(Arg &&arg)
Makes sure none of the given arguments are optimized away by the compiler.
void SHA256D64(unsigned char *out, const unsigned char *in, size_t blocks)
Compute multiple double-SHA256's of 64-byte blobs.
std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implementation)
Autodetect the best available SHA256 implementation.
uint64_t SipHashUint256(uint64_t k0, uint64_t k1, const uint256 &val)
Optimized SipHash-2-4 implementation for uint256.