aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_siv.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-10-31 05:49:34 -0400
committerJack Lloyd <[email protected]>2020-10-31 05:49:34 -0400
commit776975a5eed16d3ca49c954e4ff337ec42148df0 (patch)
treeb24a6c9633656de38729ab83b1591c0bd8322453 /src/tests/test_siv.cpp
parent57943a84c7b7a3f0881f2e4e2c4fab244601822b (diff)
Generalize SIV's support for multiple ADs to the AEAD interface
Diffstat (limited to 'src/tests/test_siv.cpp')
-rw-r--r--src/tests/test_siv.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/tests/test_siv.cpp b/src/tests/test_siv.cpp
index 886b817a6..83a936543 100644
--- a/src/tests/test_siv.cpp
+++ b/src/tests/test_siv.cpp
@@ -7,8 +7,7 @@
#include "tests.h"
#if defined(BOTAN_HAS_AEAD_SIV)
- #include <botan/siv.h>
- #include <botan/block_cipher.h>
+ #include <botan/aead.h>
#include <botan/parsing.h>
#endif
@@ -32,18 +31,18 @@ class SIV_Tests final : public Text_Based_Test
const std::vector<std::string> ad_list =
Botan::split_on(vars.get_req_str("ADs"), ',');
- Test::Result result(algo + "/SIV");
+ const std::string siv_name = algo + "/SIV";
- auto cipher = Botan::BlockCipher::create(algo);
+ Test::Result result(siv_name);
- if(!cipher)
+ auto siv = Botan::AEAD_Mode::create(siv_name, Botan::ENCRYPTION);
+
+ if(!siv)
{
result.test_note("Skipping test due to missing cipher");
return result;
}
- std::unique_ptr<Botan::SIV_Mode> siv(new Botan::SIV_Encryption(cipher.release()));
-
siv->set_key(key);
for(size_t i = 0; i != ad_list.size(); ++i)