diff options
author | Jack Lloyd <[email protected]> | 2021-04-08 10:30:16 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2021-04-08 10:40:03 -0400 |
commit | efeb1f18094c7f507ddca5d99b024b3db314cf8f (patch) | |
tree | 32143efe5125d93a63f165d051de20e99da7f5a7 /src/lib/pbkdf/argon2/argon2pwhash.cpp | |
parent | 52fa621f07cef332987b5ed891e56de98d6afa49 (diff) |
Add derive_key variant supporting AD and secret key
Diffstat (limited to 'src/lib/pbkdf/argon2/argon2pwhash.cpp')
-rw-r--r-- | src/lib/pbkdf/argon2/argon2pwhash.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/pbkdf/argon2/argon2pwhash.cpp b/src/lib/pbkdf/argon2/argon2pwhash.cpp index 6df23127c..a9d1994c3 100644 --- a/src/lib/pbkdf/argon2/argon2pwhash.cpp +++ b/src/lib/pbkdf/argon2/argon2pwhash.cpp @@ -30,6 +30,20 @@ void Argon2::derive_key(uint8_t output[], size_t output_len, m_family, m_p, m_M, m_t); } +void Argon2::derive_key(uint8_t output[], size_t output_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 + { + argon2(output, output_len, + password, password_len, + salt, salt_len, + key, key_len, + ad, ad_len, + m_family, m_p, m_M, m_t); + } + namespace { std::string argon2_family_name(uint8_t f) |