16 std::vector<uint8_t> key(32,0);
20 std::vector<uint8_t> in(buffersize,0);
21 std::vector<uint8_t> out(buffersize,0);
23 ctx.
Crypt(in.data(), out.data(), in.size());
static const uint64_t BUFFER_SIZE_LARGE
BENCHMARK(CHACHA20_64BYTES, benchmark::PriorityLevel::HIGH)
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
Unrestricted ChaCha20 cipher.
void SetIV(uint64_t iv)
set the 64-bit nonce.
void Seek64(uint64_t pos)
set the 64bit block counter (pos seeks to byte position 64*pos).
void Crypt(const unsigned char *input, unsigned char *output, size_t bytes)
enciphers the message <input> of length <bytes> and write the enciphered representation into <output>...
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.
Bench & batch(T b) noexcept
Sets the batch size.
Bench & unit(char const *unit)
Sets the operation unit.