From d2a0433344d7198f3bcee452cd347e1056dba725 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 21 Nov 2023 23:45:49 +0000 Subject: [PATCH] Benchmark for cha random too. --- benchmarks/charand.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 benchmarks/charand.c diff --git a/benchmarks/charand.c b/benchmarks/charand.c new file mode 100644 index 0000000..19625c6 --- /dev/null +++ b/benchmarks/charand.c @@ -0,0 +1,16 @@ +#include "chacha20.c" +#include +#include + +int main(void) +{ + uint64_t N = 1000000; + uint8_t* buf = malloc(N); + const uint8_t key[32] = {0}; + const uint8_t nonce[16] = {0}; + for (uint64_t i = 0; i < 1000; ++i) + { + cha_generate(buf, N, key, nonce); + } + free(buf); +}