diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-07-26 01:53:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 01:53:34 +0200 |
commit | 210176fd915cf4ba16f428d3c1a249a71f4aa7a7 (patch) | |
tree | 6998a19da1330be8679fe3e760f858915494400b /src/common/Cryptography/Authentication/AuthCrypt.h | |
parent | cdaf890af4b5bb7ce256752b49bba2c0f3ed9264 (diff) |
Core/Authserver: Authserver cleanup (PR#25093)
- Fix a handful of 1/256 bugs with most significant byte zero in BigNumber
- Get rid of (most of) the C-style arrays in authserver
- CryptoRandom as a unified source for cryptographic randomness
- Bring our other crypto APIs into 2020
- BigNumber usability improvements
- Authserver is now actually readable as a result of all of the above
Diffstat (limited to 'src/common/Cryptography/Authentication/AuthCrypt.h')
-rw-r--r-- | src/common/Cryptography/Authentication/AuthCrypt.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/common/Cryptography/Authentication/AuthCrypt.h b/src/common/Cryptography/Authentication/AuthCrypt.h index c6d4066350c..cb1a217297a 100644 --- a/src/common/Cryptography/Authentication/AuthCrypt.h +++ b/src/common/Cryptography/Authentication/AuthCrypt.h @@ -18,24 +18,23 @@ #ifndef _AUTHCRYPT_H #define _AUTHCRYPT_H -#include "Cryptography/ARC4.h" - -class BigNumber; +#include "ARC4.h" +#include <array> class TC_COMMON_API AuthCrypt { public: AuthCrypt(); - void Init(BigNumber* K); - void DecryptRecv(uint8 *, size_t); - void EncryptSend(uint8 *, size_t); + void Init(std::array<uint8, 40> const& K); + void DecryptRecv(uint8* data, size_t len); + void EncryptSend(uint8* data, size_t len); bool IsInitialized() const { return _initialized; } private: - ARC4 _clientDecrypt; - ARC4 _serverEncrypt; + Trinity::Crypto::ARC4 _clientDecrypt; + Trinity::Crypto::ARC4 _serverEncrypt; bool _initialized; }; #endif |