MCPcopy Create free account
hub / github.com/ElementsProject/elements / CHACHA20

Function CHACHA20

src/bench/chacha20.cpp:14–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12static const uint64_t BUFFER_SIZE_LARGE = 1024*1024;
13
14static 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
27static void CHACHA20_64BYTES(benchmark::Bench& bench)
28{

Callers 3

CHACHA20_64BYTESFunction · 0.85
CHACHA20_256BYTESFunction · 0.85
CHACHA20_1MBFunction · 0.85

Calls 7

SetIVMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
SeekMethod · 0.45
runMethod · 0.45
batchMethod · 0.45
CryptMethod · 0.45

Tested by

no test coverage detected