summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp')
-rw-r--r--protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp
index 40d7602d2e..98db8cf1e7 100644
--- a/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp
+++ b/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -306,14 +306,14 @@ class AesCbcDecryptBench final : public td::Benchmark {
void start_up() final {
std::fill(std::begin(data), std::end(data), static_cast<unsigned char>(123));
- td::Random::secure_bytes(as_slice(key));
- td::Random::secure_bytes(as_slice(iv));
+ td::Random::secure_bytes(as_mutable_slice(key));
+ td::Random::secure_bytes(as_mutable_slice(iv));
}
void run(int n) final {
td::MutableSlice data_slice(data, DATA_SIZE);
for (int i = 0; i < n; i++) {
- td::aes_cbc_decrypt(as_slice(key), as_slice(iv), data_slice, data_slice);
+ td::aes_cbc_decrypt(as_slice(key), as_mutable_slice(iv), data_slice, data_slice);
}
}
};
@@ -330,14 +330,14 @@ class AesCbcEncryptBench final : public td::Benchmark {
void start_up() final {
std::fill(std::begin(data), std::end(data), static_cast<unsigned char>(123));
- td::Random::secure_bytes(as_slice(key));
- td::Random::secure_bytes(as_slice(iv));
+ td::Random::secure_bytes(as_mutable_slice(key));
+ td::Random::secure_bytes(as_mutable_slice(iv));
}
void run(int n) final {
td::MutableSlice data_slice(data, DATA_SIZE);
for (int i = 0; i < n; i++) {
- td::aes_cbc_encrypt(as_slice(key), as_slice(iv), data_slice, data_slice);
+ td::aes_cbc_encrypt(as_slice(key), as_mutable_slice(iv), data_slice, data_slice);
}
}
};
@@ -355,8 +355,8 @@ class AesIgeShortBench final : public td::Benchmark {
void start_up() final {
std::fill(std::begin(data), std::end(data), static_cast<unsigned char>(123));
- td::Random::secure_bytes(as_slice(key));
- td::Random::secure_bytes(as_slice(iv));
+ td::Random::secure_bytes(as_mutable_slice(key));
+ td::Random::secure_bytes(as_mutable_slice(iv));
}
void run(int n) final {
@@ -367,7 +367,7 @@ class AesIgeShortBench final : public td::Benchmark {
ige.init(as_slice(key), as_slice(iv), false);
ige.decrypt(data_slice, data_slice);
} else {
- td::aes_ige_decrypt(as_slice(key), as_slice(iv), data_slice, data_slice);
+ td::aes_ige_decrypt(as_slice(key), as_mutable_slice(iv), data_slice, data_slice);
}
}
}
@@ -451,7 +451,7 @@ class Crc32Bench final : public td::Benchmark {
alignas(64) unsigned char data[DATA_SIZE];
std::string get_description() const final {
- return PSTRING() << "Crc32 zlib [" << (DATA_SIZE >> 10) << "KB]";
+ return PSTRING() << "CRC32 zlib [" << (DATA_SIZE >> 10) << "KB]";
}
void start_up() final {
@@ -472,7 +472,7 @@ class Crc64Bench final : public td::Benchmark {
alignas(64) unsigned char data[DATA_SIZE];
std::string get_description() const final {
- return PSTRING() << "Crc64 Anton [" << (DATA_SIZE >> 10) << "KB]";
+ return PSTRING() << "CRC64 Anton [" << (DATA_SIZE >> 10) << "KB]";
}
void start_up() final {