Botan 3.4.0
Crypto and TLS for C&
argon2fmt.h
Go to the documentation of this file.
1/**
2* (C) 2018,2019,2021 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#ifndef BOTAN_ARGON2_FMT_H_
8#define BOTAN_ARGON2_FMT_H_
9
10#include <botan/types.h>
11#include <string>
12
13namespace Botan {
14
15class RandomNumberGenerator;
16
17std::string BOTAN_PUBLIC_API(2, 11) argon2_generate_pwhash(const char* password,
18 size_t password_len,
19 RandomNumberGenerator& rng,
20 size_t p,
21 size_t M,
22 size_t t,
23 uint8_t y = 2,
24 size_t salt_len = 16,
25 size_t output_len = 32);
26
27/**
28* Check a previously created password hash
29* @param password the password to check against
30* @param password_len the length of password
31* @param hash the stored hash to check against
32*/
33bool BOTAN_PUBLIC_API(2, 11) argon2_check_pwhash(const char* password, size_t password_len, std::string_view hash);
34
35} // namespace Botan
36
37#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31
bool argon2_check_pwhash(const char *password, size_t password_len, std::string_view input_hash)
Definition argon2fmt.cpp:77
std::string argon2_generate_pwhash(const char *password, size_t password_len, RandomNumberGenerator &rng, size_t p, size_t M, size_t t, uint8_t y, size_t salt_len, size_t output_len)
Definition argon2fmt.cpp:42