refactor(Core): remove ace_autoptr, cleanup (#3276)

This commit is contained in:
Viste
2020-08-25 13:52:22 +03:00
committed by GitHub
parent 208c257b99
commit a9b90c9a07
7 changed files with 46 additions and 42 deletions

View File

@@ -6,7 +6,8 @@
#include "HMACSHA1.h"
#include "BigNumber.h"
#include "Common.h"
#include "Errors.h"
#include <cstring>
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
HMAC_CTX* HMAC_CTX_new()
@@ -23,8 +24,7 @@ void HMAC_CTX_free(HMAC_CTX* ctx)
}
#endif
HmacHash::HmacHash(uint32 len, uint8 *seed)
HmacHash::HmacHash(uint32 len, uint8* seed)
{
m_ctx = HMAC_CTX_new();
HMAC_Init_ex(m_ctx, seed, len, EVP_sha1(), nullptr);
@@ -36,14 +36,14 @@ HmacHash::~HmacHash()
HMAC_CTX_free(m_ctx);
}
void HmacHash::UpdateData(const std::string &str)
void HmacHash::UpdateData(std::string const& str)
{
HMAC_Update(m_ctx, reinterpret_cast<uint8 const*>(str.c_str()), str.length());
}
void HmacHash::UpdateData(const uint8* data, size_t len)
void HmacHash::UpdateData(uint8 const* data, size_t len)
{
HMAC_Update(m_ctx, data, len);
HMAC_Update(m_ctx, data, len);
}
void HmacHash::Finalize()