7#ifndef BOTAN_PBKDF_BCRYPT_H_
8#define BOTAN_PBKDF_BCRYPT_H_
10#include <botan/pwdhash.h>
35 size_t salt_len)
const override;
39 size_t iterations()
const override {
return m_iterations; }
55 std::string
name()
const override;
57 std::unique_ptr<PasswordHash> tune(
size_t output_length,
58 std::chrono::milliseconds msec,
60 std::chrono::milliseconds tune_msec)
const override;
62 std::unique_ptr<PasswordHash> default_params()
const override;
64 std::unique_ptr<PasswordHash> from_iterations(
size_t iter)
const override;
66 std::unique_ptr<PasswordHash> from_params(
size_t i,
size_t,
size_t)
const override;
74inline
void bcrypt_pbkdf(uint8_t output[],
81 auto pwdhash_fam = PasswordHashFamily::create_or_throw(
"Bcrypt-PBKDF");
82 auto pwdhash = pwdhash_fam->from_params(rounds);
83 pwdhash->derive_key(output, output_len, password, password_len, salt, salt_len);
Bcrypt_PBKDF_Family()=default
Bcrypt_PBKDF(const Bcrypt_PBKDF &other)=default
size_t iterations() const override
size_t total_memory_usage() const override
size_t parallelism() const override
size_t memory_param() const override
Bcrypt_PBKDF & operator=(const Bcrypt_PBKDF &)=default
virtual void derive_key(uint8_t out[], size_t out_len, const char *password, size_t password_len, const uint8_t salt[], size_t salt_len) const =0
virtual std::string to_string() const =0
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
#define BOTAN_DEPRECATED(msg)
void bcrypt_pbkdf(uint8_t output[], size_t output_len, const char *password, size_t password_len, const uint8_t salt[], size_t salt_len, size_t rounds)