diff options
author | Jack Lloyd <[email protected]> | 2019-05-30 19:19:06 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-05-30 19:19:06 -0400 |
commit | 1b44def2aec87601cd9ffbd2362ab59127bfc2ca (patch) | |
tree | 1fe1ca47c79d499bff621fc3816973458d7466bd /src/lib/pbkdf/pwdhash.cpp | |
parent | 22440b7644c9ff90610cb5db3dfcaf931aff34af (diff) | |
parent | bbc6fc46949c4db5ecd0ef720b32b8fa90ed9a8d (diff) |
Merge GH #1987 Argon2 improvements
Diffstat (limited to 'src/lib/pbkdf/pwdhash.cpp')
-rw-r--r-- | src/lib/pbkdf/pwdhash.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/pbkdf/pwdhash.cpp b/src/lib/pbkdf/pwdhash.cpp index 610ae7ac7..f5ee26c6a 100644 --- a/src/lib/pbkdf/pwdhash.cpp +++ b/src/lib/pbkdf/pwdhash.cpp @@ -20,6 +20,10 @@ #include <botan/scrypt.h> #endif +#if defined(BOTAN_HAS_ARGON2) + #include <botan/argon2.h> +#endif + namespace Botan { std::unique_ptr<PasswordHashFamily> PasswordHashFamily::create(const std::string& algo_spec, @@ -52,6 +56,21 @@ std::unique_ptr<PasswordHashFamily> PasswordHashFamily::create(const std::string } #endif +#if defined(BOTAN_HAS_ARGON2) + if(req.algo_name() == "Argon2d") + { + return std::unique_ptr<PasswordHashFamily>(new Argon2_Family(0)); + } + else if(req.algo_name() == "Argon2i") + { + return std::unique_ptr<PasswordHashFamily>(new Argon2_Family(1)); + } + else if(req.algo_name() == "Argon2id") + { + return std::unique_ptr<PasswordHashFamily>(new Argon2_Family(2)); + } +#endif + #if defined(BOTAN_HAS_PGP_S2K) if(req.algo_name() == "OpenPGP-S2K" && req.arg_count() == 1) { |