aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/kat_block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/kat_block.cpp')
-rw-r--r--src/tests/kat_block.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/tests/kat_block.cpp b/src/tests/kat_block.cpp
index 9da33ef0e..2ef5f8979 100644
--- a/src/tests/kat_block.cpp
+++ b/src/tests/kat_block.cpp
@@ -45,10 +45,9 @@ size_t block_test(const std::string& algo,
{
std::cout << algo << " " << provider << " enc " << hex_encode(buf) << " != " << out_hex << "\n";
++fails;
+ buf = ct;
}
- buf = ct;
-
cipher->decrypt(buf);
if(buf != pt)
@@ -65,11 +64,16 @@ size_t block_test(const std::string& algo,
size_t test_block()
{
- std::ifstream vec(TEST_DATA_DIR "/block.vec");
+ auto test_bc = [](const std::string& input)
+ {
+ std::ifstream vec(input);
+
+ return run_tests_bb(vec, "BlockCipher", "Out", true,
+ [](std::map<std::string, std::string> m) -> size_t
+ {
+ return block_test(m["BlockCipher"], m["Key"], m["In"], m["Out"]);
+ });
+ };
- return run_tests_bb(vec, "BlockCipher", "Out", true,
- [](std::map<std::string, std::string> m) -> size_t
- {
- return block_test(m["BlockCipher"], m["Key"], m["In"], m["Out"]);
- });
+ return run_tests_in_dir(TEST_DATA_DIR "block", test_bc);
}