From ad6555f522ae16f6284e8dafa02f630b88bcf289 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 10 Jan 2014 23:07:16 +0000 Subject: Split up docs into the reference manual, the website, and everything else. Add `website` target to makefile. Some progress towards fixing minimized builds. TLS now hard requires ECDSA and GCM since otherwise a minimized build has only insecure options. Remove boost_thread dependency in command line tool --- src/tests/test_pbkdf.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/tests/test_pbkdf.cpp (limited to 'src/tests/test_pbkdf.cpp') diff --git a/src/tests/test_pbkdf.cpp b/src/tests/test_pbkdf.cpp new file mode 100644 index 000000000..5d97bf0e9 --- /dev/null +++ b/src/tests/test_pbkdf.cpp @@ -0,0 +1,32 @@ +#include "tests.h" + +#include +#include +#include +#include + +using namespace Botan; + +size_t test_pbkdf() + { + auto test = [](const std::string& input) + { + return run_tests(input, "PBKDF", "Output", true, + [](std::map vec) + { + std::unique_ptr pbkdf(get_pbkdf(vec["PBKDF"])); + + const size_t iterations = to_u32bit(vec["Iterations"]); + const size_t outlen = to_u32bit(vec["OutputLen"]); + const auto salt = hex_decode(vec["Salt"]); + const std::string pass = vec["Passphrase"]; + + const auto key = pbkdf->derive_key(outlen, pass, + &salt[0], salt.size(), + iterations).bits_of(); + return hex_encode(key); + }); + }; + + return run_tests_in_dir(TEST_DATA_DIR "pbkdf", test); + } -- cgit v1.2.3