20static const uint8_t
k1[32] = {0};
21static const uint8_t
k2[32] = {0};
26 bool include_decryption) {
27 std::vector<uint8_t> in(
29 std::vector<uint8_t> out(
31 uint64_t seqnr_payload = 0;
32 uint64_t seqnr_aad = 0;
38 out.size(), in.data(), buffersize,
true));
40 if (include_decryption) {
44 out.size(), in.data(), buffersize,
true));
55 if (seqnr_payload + 1 == std::numeric_limits<uint64_t>::max()) {
97 std::vector<uint8_t> in(buffersize, 0);
static void CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT(benchmark::Bench &bench)
static constexpr uint64_t BUFFER_SIZE_LARGE
static const uint8_t k1[32]
static void HASH_1MB(benchmark::Bench &bench)
static void CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT(benchmark::Bench &bench)
static void CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT(benchmark::Bench &bench)
static void CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT(benchmark::Bench &bench)
static void HASH_256BYTES(benchmark::Bench &bench)
static constexpr uint64_t BUFFER_SIZE_TINY
static constexpr uint64_t BUFFER_SIZE_SMALL
BENCHMARK(CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT)
static void CHACHA20_POLY1305_AEAD(benchmark::Bench &bench, size_t buffersize, bool include_decryption)
static ChaCha20Poly1305AEAD aead(k1, 32, k2, 32)
static void CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT(benchmark::Bench &bench)
static void HASH(benchmark::Bench &bench, size_t buffersize)
static void CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT(benchmark::Bench &bench)
static void HASH_64BYTES(benchmark::Bench &bench)
static const uint8_t k2[32]
static constexpr int CHACHA20_POLY1305_AEAD_AAD_LEN
static constexpr int CHACHA20_ROUND_OUTPUT
A hasher class for Bitcoin's 256-bit hash (double SHA-256).
CHash256 & Write(Span< const uint8_t > input)
void Finalize(Span< uint8_t > output)
static const size_t OUTPUT_SIZE
bool Crypt(uint64_t seqnr_payload, uint64_t seqnr_aad, int aad_pos, uint8_t *dest, size_t dest_len, const uint8_t *src, size_t src_len, bool is_encrypt)
Encrypts/decrypts a packet.
bool GetLength(uint32_t *len24_out, uint64_t seqnr_aad, int aad_pos, const uint8_t *ciphertext)
decrypts the 3 bytes AAD data and decodes it into a uint32_t field
Main entry point to nanobench's benchmarking facility.
ANKERL_NANOBENCH(NODISCARD) std Bench & batch(T b) noexcept
Sets the batch size.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Bench & unit(char const *unit)
Sets the operation unit.