#include "Argon2.h"
◆ Hash()
22{
24 std::vector<uint8> saltBytes = salt.ToByteVector();
25 int status = argon2id_hash_encoded(
26 nIterations,
27 kibMemoryCost,
29 password.c_str(), password.length(),
30 saltBytes.data(), saltBytes.size(),
32 );
33
34 if (status == ARGON2_OK)
35 return std::string(buf);
36
37 return {};
38}
static constexpr uint32 ENCODED_HASH_LEN
Definition Argon2.h:29
static constexpr uint32 PARALLELISM
Definition Argon2.h:32
static constexpr uint32 HASH_LEN
Definition Argon2.h:28
References ENCODED_HASH_LEN, HASH_LEN, PARALLELISM, and BigNumber::ToByteVector().
Referenced by SecretMgr::AttemptTransition().
◆ Verify()
bool Acore::Crypto::Argon2::Verify |
( |
std::string const & |
password, |
|
|
std::string const & |
hash |
|
) |
| |
|
static |
41{
42 int status = argon2id_verify(hash.c_str(), password.c_str(), password.length());
43 return (status == ARGON2_OK);
44}
Referenced by SecretMgr::AttemptLoad().
◆ DEFAULT_ITERATIONS
constexpr uint32 Acore::Crypto::Argon2::DEFAULT_ITERATIONS = 10 |
|
staticconstexpr |
◆ DEFAULT_MEMORY_COST
constexpr uint32 Acore::Crypto::Argon2::DEFAULT_MEMORY_COST = (1u << 17) |
|
staticconstexpr |
◆ ENCODED_HASH_LEN
constexpr uint32 Acore::Crypto::Argon2::ENCODED_HASH_LEN = 100 |
|
staticconstexpr |
◆ HASH_LEN
constexpr uint32 Acore::Crypto::Argon2::HASH_LEN = 16 |
|
staticconstexpr |
◆ PARALLELISM
constexpr uint32 Acore::Crypto::Argon2::PARALLELISM = 1 |
|
staticconstexpr |
The documentation for this struct was generated from the following files:
- azerothcore-wotlk/src/common/Cryptography/Argon2.h
- azerothcore-wotlk/src/common/Cryptography/Argon2.cpp