7 #include <botan/pwdhash.h>
8 #include <botan/exceptn.h>
9 #include <botan/scan_name.h>
11 #if defined(BOTAN_HAS_PBKDF2)
12 #include <botan/pbkdf2.h>
15 #if defined(BOTAN_HAS_PGP_S2K)
16 #include <botan/pgp_s2k.h>
19 #if defined(BOTAN_HAS_SCRYPT)
20 #include <botan/scrypt.h>
23 #if defined(BOTAN_HAS_ARGON2)
24 #include <botan/argon2.h>
27 #if defined(BOTAN_HAS_PBKDF_BCRYPT)
28 #include <botan/bcrypt_pbkdf.h>
34 const std::string& provider)
38 #if defined(BOTAN_HAS_PBKDF2)
43 if(provider.empty() || provider ==
"base")
46 return std::unique_ptr<PasswordHashFamily>(
new PBKDF2_Family(mac.release()));
49 return std::unique_ptr<PasswordHashFamily>(
new PBKDF2_Family(mac.release()));
56 #if defined(BOTAN_HAS_SCRYPT)
59 return std::unique_ptr<PasswordHashFamily>(
new Scrypt_Family);
63 #if defined(BOTAN_HAS_ARGON2)
66 return std::unique_ptr<PasswordHashFamily>(
new Argon2_Family(0));
70 return std::unique_ptr<PasswordHashFamily>(
new Argon2_Family(1));
74 return std::unique_ptr<PasswordHashFamily>(
new Argon2_Family(2));
78 #if defined(BOTAN_HAS_PBKDF_BCRYPT)
85 #if defined(BOTAN_HAS_PGP_S2K)
102 std::unique_ptr<PasswordHashFamily>
104 const std::string& provider)
110 throw Lookup_Error(
"PasswordHashFamily", algo, provider);
115 return probe_providers_of<PasswordHashFamily>(algo_spec, {
"base",
"openssl" });
std::string arg(size_t i) const
static std::unique_ptr< MessageAuthenticationCode > create(const std::string &algo_spec, const std::string &provider="")
static std::vector< std::string > providers(const std::string &algo_spec)
static std::unique_ptr< PasswordHashFamily > create_or_throw(const std::string &algo_spec, const std::string &provider="")
static std::unique_ptr< HashFunction > create(const std::string &algo_spec, const std::string &provider="")
static std::unique_ptr< PasswordHashFamily > create(const std::string &algo_spec, const std::string &provider="")
#define BOTAN_UNUSED(...)
const std::string & algo_name() const