/* * (C) 2014,2015 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #include "tests.h" #include #include #include #include #include using namespace Botan; size_t test_kdf() { auto test = [](const std::string& input) { return run_tests(input, "KDF", "Output", true, [](std::map vec) { std::unique_ptr kdf(get_kdf(vec["KDF"])); const size_t outlen = to_u32bit(vec["OutputLen"]); const auto salt = hex_decode(vec["Salt"]); const auto secret = hex_decode(vec["Secret"]); const auto key = kdf->derive_key(outlen, secret, salt); return hex_encode(key); }); }; return run_tests_in_dir(TEST_DATA_DIR "kdf", test); }