aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_pbkdf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test_pbkdf.cpp')
-rw-r--r--src/tests/test_pbkdf.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tests/test_pbkdf.cpp b/src/tests/test_pbkdf.cpp
index 393a96243..af2cdd498 100644
--- a/src/tests/test_pbkdf.cpp
+++ b/src/tests/test_pbkdf.cpp
@@ -24,6 +24,12 @@ class PBKDF_KAT_Tests : public Text_Based_Test
Test::Result run_one_test(const std::string& pbkdf_name, const VarMap& vars) override
{
+ const size_t outlen = get_req_sz(vars, "OutputLen");
+ const size_t iterations = get_req_sz(vars, "Iterations");
+ const std::vector<uint8_t> salt = get_req_bin(vars, "Salt");
+ const std::string passphrase = get_req_str(vars, "Passphrase");
+ const std::vector<uint8_t> expected = get_req_bin(vars, "Output");
+
Test::Result result(pbkdf_name);
std::unique_ptr<Botan::PBKDF> pbkdf(Botan::PBKDF::create(pbkdf_name));
@@ -33,11 +39,7 @@ class PBKDF_KAT_Tests : public Text_Based_Test
return result;
}
- const size_t outlen = get_req_sz(vars, "OutputLen");
- const size_t iterations = get_req_sz(vars, "Iterations");
- const std::vector<uint8_t> salt = get_req_bin(vars, "Salt");
- const std::string passphrase = get_req_str(vars, "Passphrase");
- const std::vector<uint8_t> expected = get_req_bin(vars, "Output");
+ result.test_eq("Expected name", pbkdf->name(), pbkdf_name);
const Botan::secure_vector<byte> derived =
pbkdf->derive_key(outlen, passphrase, salt.data(), salt.size(), iterations).bits_of();