11#include <botan/pwdhash.h>
23 Scrypt(
size_t N,
size_t r,
size_t p);
36 size_t salt_len)
const override;
54 std::string
name()
const override;
56 std::unique_ptr<PasswordHash> tune(
size_t output_length,
57 std::chrono::milliseconds msec,
59 std::chrono::milliseconds tune_msec)
const override;
61 std::unique_ptr<PasswordHash> default_params()
const override;
63 std::unique_ptr<PasswordHash> from_iterations(
size_t iter)
const override;
65 std::unique_ptr<PasswordHash> from_params(
size_t N,
size_t r,
size_t p)
const override;
86inline
void scrypt(uint8_t output[],
95 auto pwdhash_fam = PasswordHashFamily::create_or_throw(
"Scrypt");
96 auto pwdhash = pwdhash_fam->from_params(N, r, p);
97 pwdhash->derive_key(output, output_len, password, password_len, salt, salt_len);
118inline
void scrypt(uint8_t output[],
120 std::string_view password,
121 const uint8_t salt[],
126 auto pwdhash_fam = PasswordHashFamily::create_or_throw(
"Scrypt");
127 auto pwdhash = pwdhash_fam->from_params(N, r, p);
128 pwdhash->derive_key(output, output_len, password.data(), password.size(), salt, salt_len);
virtual size_t total_memory_usage() const
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
Scrypt & operator=(const Scrypt &)=default
size_t memory_param() const override
Scrypt(const Scrypt &other)=default
size_t iterations() const override
size_t parallelism() const override
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
#define BOTAN_DEPRECATED(msg)
void scrypt(uint8_t output[], size_t output_len, const char *password, size_t password_len, const uint8_t salt[], size_t salt_len, size_t N, size_t r, size_t p)