TrinityCore
Loading...
Searching...
No Matches
Trinity::Crypto::AES Class Reference

#include <AES.h>

Public Types

using IV = std::array< uint8, IV_SIZE_BYTES >
 
using Key = std::array< uint8, KEY_SIZE_BYTES >
 
using Tag = uint8[TAG_SIZE_BYTES]
 

Public Member Functions

 AES (bool encrypting, size_t keySizeBits=128)
 
 AES (AES const &)=delete
 
 AES (AES &&)=delete
 
AESoperator= (AES const &)=delete
 
AESoperator= (AES &&)=delete
 
 ~AES ()
 
void Init (Key const &key)
 
void Init (std::span< uint8 const > key)
 
bool Process (IV const &iv, uint8 *data, size_t length, Tag &tag)
 
bool ProcessNoIntegrityCheck (IV const &iv, uint8 *data, size_t partialLength)
 

Static Public Attributes

static constexpr size_t IV_SIZE_BYTES = 12
 
static constexpr size_t KEY_SIZE_BYTES = 16
 
static constexpr size_t TAG_SIZE_BYTES = 12
 

Private Attributes

EVP_CIPHER_CTX * _ctx
 
bool _encrypting
 

Detailed Description

Definition at line 28 of file AES.h.

Member Typedef Documentation

◆ IV

Definition at line 35 of file AES.h.

◆ Key

Definition at line 36 of file AES.h.

◆ Tag

Definition at line 37 of file AES.h.

Constructor & Destructor Documentation

◆ AES() [1/3]

Trinity::Crypto::AES::AES ( bool  encrypting,
size_t  keySizeBits = 128 
)

Definition at line 22 of file AES.cpp.

◆ AES() [2/3]

Trinity::Crypto::AES::AES ( AES const &  )
delete

◆ AES() [3/3]

Trinity::Crypto::AES::AES ( AES &&  )
delete

◆ ~AES()

Trinity::Crypto::AES::~AES ( )

Definition at line 45 of file AES.cpp.

Member Function Documentation

◆ Init() [1/2]

void Trinity::Crypto::AES::Init ( Key const &  key)

Definition at line 50 of file AES.cpp.

+ Here is the caller graph for this function:

◆ Init() [2/2]

void Trinity::Crypto::AES::Init ( std::span< uint8 const >  key)

Definition at line 56 of file AES.cpp.

◆ operator=() [1/2]

AES & Trinity::Crypto::AES::operator= ( AES &&  )
delete

◆ operator=() [2/2]

AES & Trinity::Crypto::AES::operator= ( AES const &  )
delete

◆ Process()

bool Trinity::Crypto::AES::Process ( IV const &  iv,
uint8 data,
size_t  length,
Tag tag 
)

Definition at line 63 of file AES.cpp.

+ Here is the caller graph for this function:

◆ ProcessNoIntegrityCheck()

bool Trinity::Crypto::AES::ProcessNoIntegrityCheck ( IV const &  iv,
uint8 data,
size_t  partialLength 
)

Definition at line 90 of file AES.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _ctx

EVP_CIPHER_CTX* Trinity::Crypto::AES::_ctx
private

Definition at line 53 of file AES.h.

◆ _encrypting

bool Trinity::Crypto::AES::_encrypting
private

Definition at line 54 of file AES.h.

◆ IV_SIZE_BYTES

constexpr size_t Trinity::Crypto::AES::IV_SIZE_BYTES = 12
staticconstexpr

Definition at line 31 of file AES.h.

◆ KEY_SIZE_BYTES

constexpr size_t Trinity::Crypto::AES::KEY_SIZE_BYTES = 16
staticconstexpr

Definition at line 32 of file AES.h.

◆ TAG_SIZE_BYTES

constexpr size_t Trinity::Crypto::AES::TAG_SIZE_BYTES = 12
staticconstexpr

Definition at line 33 of file AES.h.


The documentation for this class was generated from the following files: