TrinityCore
Loading...
Searching...
No Matches
AES.h
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef Trinity_AES_h__
19
#define Trinity_AES_h__
20
21
#include "
Define.h
"
22
#include <array>
23
#include <openssl/evp.h>
24
25
namespace
Trinity::Crypto
26
{
27
class
TC_COMMON_API
AES
28
{
29
public
:
30
static
constexpr
size_t
IV_SIZE_BYTES = 12;
31
static
constexpr
size_t
KEY_SIZE_BYTES = 16;
32
static
constexpr
size_t
TAG_SIZE_BYTES = 12;
33
34
using
IV
= std::array<uint8, IV_SIZE_BYTES>;
35
using
Key
= std::array<uint8, KEY_SIZE_BYTES>;
36
using
Tag
=
uint8
[TAG_SIZE_BYTES];
37
38
AES
(
bool
encrypting);
39
~AES
();
40
41
void
Init(
Key
const
& key);
42
43
bool
Process(
IV
const
& iv,
uint8
* data,
size_t
length,
Tag
& tag);
44
45
private
:
46
EVP_CIPHER_CTX*
_ctx
;
47
bool
_encrypting
;
48
};
49
}
50
51
#endif
// Trinity_AES_h__
Define.h
uint8
uint8_t uint8
Definition
Define.h:135
TC_COMMON_API
#define TC_COMMON_API
Definition
Define.h:96
Trinity::Crypto::AES
Definition
AES.h:28
Trinity::Crypto::AES::Tag
uint8[TAG_SIZE_BYTES] Tag
Definition
AES.h:36
Trinity::Crypto::AES::_encrypting
bool _encrypting
Definition
AES.h:47
Trinity::Crypto::AES::IV
std::array< uint8, IV_SIZE_BYTES > IV
Definition
AES.h:34
Trinity::Crypto::AES::Key
std::array< uint8, KEY_SIZE_BYTES > Key
Definition
AES.h:35
Trinity::Crypto::AES::_ctx
EVP_CIPHER_CTX * _ctx
Definition
AES.h:46
Trinity::Crypto
Definition
AES.h:26
common
Cryptography
AES.h
Generated on Sun May 10 2026 02:30:12 for TrinityCore by
1.9.8