Botan 3.6.1
Crypto and TLS for C&
|
#include <argon2.h>
Public Member Functions | |
Argon2 (const Argon2 &other)=default | |
Argon2 (uint8_t family, size_t M, size_t t, size_t p) | |
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 override |
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 uint8_t ad[], size_t ad_len, const uint8_t key[], size_t key_len) const override |
void | hash (std::span< uint8_t > out, std::string_view password, std::span< const uint8_t > salt) const |
void | hash (std::span< uint8_t > out, std::string_view password, std::span< const uint8_t > salt, std::span< const uint8_t > associated_data, std::span< const uint8_t > key) const |
size_t | iterations () const override |
size_t | M () const |
size_t | memory_param () const override |
Argon2 & | operator= (const Argon2 &)=default |
size_t | p () const |
size_t | parallelism () const override |
bool | supports_associated_data () const override |
bool | supports_keyed_operation () const override |
size_t | t () const |
std::string | to_string () const override |
size_t | total_memory_usage () const override |
Static Public Member Functions | |
static void | blamka (uint64_t N[128], uint64_t T[128]) |
Botan::Argon2::Argon2 | ( | uint8_t | family, |
size_t | M, | ||
size_t | t, | ||
size_t | p ) |
Definition at line 17 of file argon2pwhash.cpp.
References BOTAN_ARG_CHECK.
|
default |
|
static |
Argon2's BLAMKA function
Definition at line 168 of file argon2.cpp.
References Botan::copy_mem(), and T.
|
overridevirtual |
Derive a new key under the current Argon2 parameter set
Implements Botan::PasswordHash.
Definition at line 23 of file argon2pwhash.cpp.
|
overridevirtual |
Derive a key from a password plus additional data and/or a secret key
Currently this is only supported for Argon2. Using a non-empty AD or key with other algorithms will cause a Not_Implemented exception.
out | buffer to store the derived key, must be of out_len bytes |
out_len | the desired length of the key to produce |
password | the password to derive the key from |
password_len | the length of password in bytes |
salt | a randomly chosen salt |
salt_len | length of salt in bytes |
ad | some additional data |
ad_len | length of ad in bytes |
key | a secret key |
key_len | length of key in bytes |
This function is const, but is not thread safe. Different threads should either use unique objects, or serialize all access.
Reimplemented from Botan::PasswordHash.
Definition at line 32 of file argon2pwhash.cpp.
|
inlineinherited |
Hash a password into a bitstring
Derive a key from the specified password
and salt
, placing it into out
.
out | a span where the derived key will be placed |
password | the password to derive the key from |
salt | a randomly chosen salt |
This function is const, but is not thread safe. Different threads should either use unique objects, or serialize all access.
Definition at line 84 of file pwdhash.h.
|
inlineinherited |
Hash a password into a bitstring
Derive a key from the specified password
, salt
, associated_data
, and secret key
, placing it into out
. The associated_data
and key
are both allowed to be empty. Currently non-empty AD/key is only supported with Argon2.
out | a span where the derived key will be placed |
password | the password to derive the key from |
salt | a randomly chosen salt |
associated_data | some additional data |
key | a secret key |
This function is const, but is not thread safe. Different threads should either use unique objects, or serialize all access.
Definition at line 105 of file pwdhash.h.
|
inlineoverridevirtual |
Most password hashes have some notion of iterations.
Implements Botan::PasswordHash.
Definition at line 66 of file argon2.h.
|
inlineoverridevirtual |
Some password hashing algorithms have a parameter which controls how much memory is used. If not supported by some algorithm, returns 0.
Reimplemented from Botan::PasswordHash.
Definition at line 70 of file argon2.h.
|
inlineoverridevirtual |
Some password hashing algorithms have a parallelism parameter. If the algorithm does not support this notion, then the function returns zero. This allows distinguishing between a password hash which just does not support parallel operation, vs one that does support parallel operation but which has been configured to use a single lane.
Reimplemented from Botan::PasswordHash.
Definition at line 68 of file argon2.h.
|
inlineoverridevirtual |
Reimplemented from Botan::PasswordHash.
Definition at line 64 of file argon2.h.
|
inlineoverridevirtual |
Reimplemented from Botan::PasswordHash.
Definition at line 62 of file argon2.h.
|
overridevirtual |
Implements Botan::PasswordHash.
Definition at line 62 of file argon2pwhash.cpp.
References Botan::fmt().
|
inlineoverridevirtual |
Returns an estimate of the total number of bytes required to perform this key derivation.
If this algorithm uses a small and constant amount of memory, with no effort made towards being memory hard, this function returns 0.
Reimplemented from Botan::PasswordHash.
Definition at line 72 of file argon2.h.