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)
41 if(provider.empty() || provider ==
"base")
44 return std::unique_ptr<PasswordHashFamily>(
new PBKDF2_Family(mac.release()));
47 return std::unique_ptr<PasswordHashFamily>(
new PBKDF2_Family(mac.release()));
54#if defined(BOTAN_HAS_SCRYPT)
57 return std::unique_ptr<PasswordHashFamily>(
new Scrypt_Family);
61#if defined(BOTAN_HAS_ARGON2)
64 return std::unique_ptr<PasswordHashFamily>(
new Argon2_Family(0));
68 return std::unique_ptr<PasswordHashFamily>(
new Argon2_Family(1));
72 return std::unique_ptr<PasswordHashFamily>(
new Argon2_Family(2));
76#if defined(BOTAN_HAS_PBKDF_BCRYPT)
83#if defined(BOTAN_HAS_PGP_S2K)
100std::unique_ptr<PasswordHashFamily>
102 const std::string& provider)
108 throw Lookup_Error(
"PasswordHashFamily", algo, provider);
113 return probe_providers_of<PasswordHashFamily>(algo_spec, {
"base",
"openssl" });
#define BOTAN_UNUSED(...)
static std::unique_ptr< HashFunction > create(const std::string &algo_spec, const std::string &provider="")
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< PasswordHashFamily > create(const std::string &algo_spec, const std::string &provider="")
std::string arg(size_t i) const
const std::string & algo_name() const