Changeset View
Changeset View
Standalone View
Standalone View
src/bench/chacha_poly_aead.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
// Add Hash() (dbl-sha256) bench for comparison | // Add Hash() (dbl-sha256) bench for comparison | ||||
static void HASH(benchmark::State &state, size_t buffersize) { | static void HASH(benchmark::State &state, size_t buffersize) { | ||||
uint8_t hash[CHash256::OUTPUT_SIZE]; | uint8_t hash[CHash256::OUTPUT_SIZE]; | ||||
std::vector<uint8_t> in(buffersize, 0); | std::vector<uint8_t> in(buffersize, 0); | ||||
while (state.KeepRunning()) { | while (state.KeepRunning()) { | ||||
CHash256().Write(in.data(), in.size()).Finalize(hash); | CHash256().Write(in).Finalize(hash); | ||||
} | } | ||||
} | } | ||||
static void HASH_64BYTES(benchmark::State &state) { | static void HASH_64BYTES(benchmark::State &state) { | ||||
HASH(state, BUFFER_SIZE_TINY); | HASH(state, BUFFER_SIZE_TINY); | ||||
} | } | ||||
static void HASH_256BYTES(benchmark::State &state) { | static void HASH_256BYTES(benchmark::State &state) { | ||||
Show All 16 Lines |