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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user