aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pbkdf/pwdhash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pbkdf/pwdhash.cpp')
-rw-r--r--src/lib/pbkdf/pwdhash.cpp19
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)
{