From d2af5b598b6726d4d908a0fd88720ebd5099177d Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 24 Feb 2025 14:39:41 +0300 Subject: Improve types of some constants. --- benchmark/bench_crypto.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'benchmark') diff --git a/benchmark/bench_crypto.cpp b/benchmark/bench_crypto.cpp index 115d64895..8eae71394 100644 --- a/benchmark/bench_crypto.cpp +++ b/benchmark/bench_crypto.cpp @@ -27,8 +27,8 @@ #include #include -static constexpr int DATA_SIZE = 8 << 10; -static constexpr int SHORT_DATA_SIZE = 64; +static constexpr std::size_t DATA_SIZE = 8 << 10; +static constexpr std::size_t SHORT_DATA_SIZE = 64; #if OPENSSL_VERSION_NUMBER <= 0x10100000L class SHA1Bench final : public td::Benchmark { @@ -285,8 +285,9 @@ class AesCtrOpenSSLBench final : public td::Benchmark { state.init(as_slice(key), as_slice(iv)); for (int i = 0; i < n; i++) { int len = 0; - EVP_EncryptUpdate(ctx, data_slice.ubegin(), &len, data_slice.ubegin(), DATA_SIZE); - CHECK(len == DATA_SIZE); + int int_size = static_cast(DATA_SIZE); + EVP_EncryptUpdate(ctx, data_slice.ubegin(), &len, data_slice.ubegin(), int_size); + CHECK(len == int_size); } EVP_CIPHER_CTX_free(ctx); -- cgit v1.2.3