refactor(src/common): remove unused imports (#19506)

* refactor(src/common): remove unused imports

* fix: build

* chore: fix build

* chore: size_t -> std::size_t

* chore: fix fuckup from previous commit

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build with std::size_t

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build

* chore: fix build
This commit is contained in:
Francesco Borzì
2024-07-31 01:06:46 +02:00
committed by GitHub
parent 06a608d244
commit 02a05fbd4c
200 changed files with 522 additions and 581 deletions
+6 -6
View File
@@ -29,15 +29,15 @@ class BigNumber;
namespace Acore::Impl
{
template <GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
template <GenericHashImpl::HashCreator HashCreator, std::size_t DigestLength>
class GenericHMAC
{
public:
static constexpr size_t DIGEST_LENGTH = DigestLength;
static constexpr std::size_t DIGEST_LENGTH = DigestLength;
using Digest = std::array<uint8, DIGEST_LENGTH>;
template <typename Container>
static Digest GetDigestOf(Container const& seed, uint8 const* data, size_t len)
static Digest GetDigestOf(Container const& seed, uint8 const* data, std::size_t len)
{
GenericHMAC hash(seed);
hash.UpdateData(data, len);
@@ -54,7 +54,7 @@ namespace Acore::Impl
return hash.GetDigest();
}
GenericHMAC(uint8 const* seed, size_t len) : _ctx(GenericHashImpl::MakeCTX()), _key(EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, nullptr, seed, len))
GenericHMAC(uint8 const* seed, std::size_t len) : _ctx(GenericHashImpl::MakeCTX()), _key(EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, nullptr, seed, len))
{
int result = EVP_DigestSignInit(_ctx, nullptr, HashCreator(), nullptr, _key);
ASSERT(result == 1);
@@ -105,7 +105,7 @@ namespace Acore::Impl
return *this;
}
void UpdateData(uint8 const* data, size_t len)
void UpdateData(uint8 const* data, std::size_t len)
{
int result = EVP_DigestSignUpdate(_ctx, data, len);
ASSERT(result == 1);
@@ -120,7 +120,7 @@ namespace Acore::Impl
void Finalize()
{
size_t length = DIGEST_LENGTH;
std::size_t length = DIGEST_LENGTH;
int result = EVP_DigestSignFinal(_ctx, _digest.data(), &length);
ASSERT(result == 1);
ASSERT(length == DIGEST_LENGTH);