aboutsummaryrefslogtreecommitdiff
path: root/src/bench/chacha20.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2023-07-18 10:11:49 -0400
committerPieter Wuille <pieter@wuille.net>2023-08-17 15:26:34 -0400
commit3da636e08b781fa2f7c1c23bb937015185732a75 (patch)
tree11908cad2b43f2995362e497a96cb694910b7573 /src/bench/chacha20.cpp
parent6ce5e8f4758e6fccf59b3980af417ec6c75e383e (diff)
downloadbitcoin-3da636e08b781fa2f7c1c23bb937015185732a75.tar.xz
crypto: refactor ChaCha20 classes to use Span<std::byte> interface
Diffstat (limited to 'src/bench/chacha20.cpp')
-rw-r--r--src/bench/chacha20.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bench/chacha20.cpp b/src/bench/chacha20.cpp
index d8bebf9319..e0bb07d8be 100644
--- a/src/bench/chacha20.cpp
+++ b/src/bench/chacha20.cpp
@@ -14,13 +14,13 @@ static const uint64_t BUFFER_SIZE_LARGE = 1024*1024;
static void CHACHA20(benchmark::Bench& bench, size_t buffersize)
{
- std::vector<uint8_t> key(32,0);
- ChaCha20 ctx(key.data());
- ctx.Seek64({0, 0}, 0);
- std::vector<uint8_t> in(buffersize,0);
- std::vector<uint8_t> out(buffersize,0);
+ std::vector<std::byte> key(32, {});
+ ChaCha20 ctx(key);
+ ctx.Seek({0, 0}, 0);
+ std::vector<std::byte> in(buffersize, {});
+ std::vector<std::byte> out(buffersize, {});
bench.batch(in.size()).unit("byte").run([&] {
- ctx.Crypt(in.data(), out.data(), in.size());
+ ctx.Crypt(in, out);
});
}