aboutsummaryrefslogtreecommitdiff
path: root/src/common/Cryptography/AES.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Cryptography/AES.h')
-rw-r--r--src/common/Cryptography/AES.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/common/Cryptography/AES.h b/src/common/Cryptography/AES.h
index d0ff2114b02..ca997030077 100644
--- a/src/common/Cryptography/AES.h
+++ b/src/common/Cryptography/AES.h
@@ -22,33 +22,30 @@
#include <array>
#include <openssl/evp.h>
-namespace Trinity
+namespace Trinity::Crypto
{
-namespace Crypto
-{
-class TC_COMMON_API AES
-{
-public:
- static constexpr std::size_t IV_SIZE_BYTES = 12;
- static constexpr std::size_t KEY_SIZE_BYTES = 16;
- static constexpr std::size_t TAG_SIZE_BYTES = 12;
+ class TC_COMMON_API AES
+ {
+ public:
+ static constexpr size_t IV_SIZE_BYTES = 12;
+ static constexpr size_t KEY_SIZE_BYTES = 16;
+ static constexpr size_t TAG_SIZE_BYTES = 12;
- using IV = std::array<uint8, IV_SIZE_BYTES>;
- using Key = std::array<uint8, KEY_SIZE_BYTES>;
- using Tag = uint8[TAG_SIZE_BYTES];
+ using IV = std::array<uint8, IV_SIZE_BYTES>;
+ using Key = std::array<uint8, KEY_SIZE_BYTES>;
+ using Tag = uint8[TAG_SIZE_BYTES];
- AES(bool encrypting);
- ~AES();
+ AES(bool encrypting);
+ ~AES();
- void Init(Key const& key);
+ void Init(Key const& key);
- bool Process(IV const& iv, uint8* data, std::size_t length, Tag& tag);
+ bool Process(IV const& iv, uint8* data, size_t length, Tag& tag);
-private:
- EVP_CIPHER_CTX* _ctx;
- bool _encrypting;
-};
-}
+ private:
+ EVP_CIPHER_CTX* _ctx;
+ bool _encrypting;
+ };
}
#endif // Trinity_AES_h__