mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
refactor(Core/Misc): acore to Acore (#6043)
This commit is contained in:
@@ -7,25 +7,25 @@
|
||||
#include "Errors.h"
|
||||
#include <limits>
|
||||
|
||||
acore::Crypto::AES::AES(bool encrypting) : _ctx(EVP_CIPHER_CTX_new()), _encrypting(encrypting)
|
||||
Acore::Crypto::AES::AES(bool encrypting) : _ctx(EVP_CIPHER_CTX_new()), _encrypting(encrypting)
|
||||
{
|
||||
EVP_CIPHER_CTX_init(_ctx);
|
||||
int status = EVP_CipherInit_ex(_ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr, _encrypting ? 1 : 0);
|
||||
ASSERT(status);
|
||||
}
|
||||
|
||||
acore::Crypto::AES::~AES()
|
||||
Acore::Crypto::AES::~AES()
|
||||
{
|
||||
EVP_CIPHER_CTX_free(_ctx);
|
||||
}
|
||||
|
||||
void acore::Crypto::AES::Init(Key const& key)
|
||||
void Acore::Crypto::AES::Init(Key const& key)
|
||||
{
|
||||
int status = EVP_CipherInit_ex(_ctx, nullptr, nullptr, key.data(), nullptr, -1);
|
||||
ASSERT(status);
|
||||
}
|
||||
|
||||
bool acore::Crypto::AES::Process(IV const& iv, uint8* data, size_t length, Tag& tag)
|
||||
bool Acore::Crypto::AES::Process(IV const& iv, uint8* data, size_t length, Tag& tag)
|
||||
{
|
||||
ASSERT(length <= static_cast<size_t>(std::numeric_limits<int>::max()));
|
||||
int len = static_cast<int>(length);
|
||||
|
||||
Reference in New Issue
Block a user