| 12 | static const uint64_t BUFFER_SIZE_LARGE = 1024*1024; |
| 13 | |
| 14 | static void CHACHA20(benchmark::Bench& bench, size_t buffersize) |
| 15 | { |
| 16 | std::vector<uint8_t> key(32,0); |
| 17 | ChaCha20 ctx(key.data(), key.size()); |
| 18 | ctx.SetIV(0); |
| 19 | ctx.Seek(0); |
| 20 | std::vector<uint8_t> in(buffersize,0); |
| 21 | std::vector<uint8_t> out(buffersize,0); |
| 22 | bench.batch(in.size()).unit("byte").run([&] { |
| 23 | ctx.Crypt(in.data(), out.data(), in.size()); |
| 24 | }); |
| 25 | } |
| 26 | |
| 27 | static void CHACHA20_64BYTES(benchmark::Bench& bench) |
| 28 | { |