17 std::vector<uint8_t> key(32, 0);
23 bench.batch(
in.size()).unit(
"byte").run(
24 [&] {
ctx.Crypt(
in.data(), out.data(),
in.size()); });
static const uint64_t BUFFER_SIZE_LARGE
static void CHACHA20_256BYTES(benchmark::Bench &bench)
static void CHACHA20(benchmark::Bench &bench, size_t buffersize)
static const uint64_t BUFFER_SIZE_TINY
static void CHACHA20_1MB(benchmark::Bench &bench)
static void CHACHA20_64BYTES(benchmark::Bench &bench)
static const uint64_t BUFFER_SIZE_SMALL
A class for ChaCha20 256-bit stream cipher developed by Daniel J.
Main entry point to nanobench's benchmarking facility.
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...