diff options
author | Jack Lloyd <[email protected]> | 2021-04-15 07:52:53 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2021-04-15 08:00:45 -0400 |
commit | 0c3036417bebf12457e060666c4ee9447e73c583 (patch) | |
tree | a3d8f5eada5ef0796715a6f8cc1dba4c548b8ef3 /src/lib/pbkdf | |
parent | 776e4eb7ce241dafd213d0069c7105ab9bf9ac2a (diff) |
Avoid using the bare argon2() function
Diffstat (limited to 'src/lib/pbkdf')
-rw-r--r-- | src/lib/pbkdf/argon2/argon2pwhash.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/pbkdf/argon2/argon2pwhash.cpp b/src/lib/pbkdf/argon2/argon2pwhash.cpp index 9886ba723..0bf2210d0 100644 --- a/src/lib/pbkdf/argon2/argon2pwhash.cpp +++ b/src/lib/pbkdf/argon2/argon2pwhash.cpp @@ -99,9 +99,13 @@ std::unique_ptr<PasswordHash> Argon2_Family::tune(size_t /*output_length*/, Timer timer("Argon2"); const auto tune_time = BOTAN_PBKDF_TUNING_TIME; + auto pwhash = this->from_params(tune_M, t, p); + timer.run_until_elapsed(tune_time, [&]() { uint8_t output[64] = { 0 }; - argon2(output, sizeof(output), "test", 4, nullptr, 0, nullptr, 0, nullptr, 0, m_family, p, tune_M, t); + pwhash->derive_key(output, sizeof(output), + "test", 4, + nullptr, 0); }); if(timer.events() == 0 || timer.value() == 0) |