aboutsummaryrefslogtreecommitdiffstats
path: root/src/selftest/selftest.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-03-27 16:49:14 +0000
committerlloyd <[email protected]>2013-03-27 16:49:14 +0000
commit91840883da6009ee17c81749e5077e610532654d (patch)
treea5c055eaebf80efbd9240f1694534102bd13f583 /src/selftest/selftest.cpp
parente7d24d7884025c2051450a9c9d9ce0f944a8fa4a (diff)
Fix macro check in selftest
Diffstat (limited to 'src/selftest/selftest.cpp')
-rw-r--r--src/selftest/selftest.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/selftest/selftest.cpp b/src/selftest/selftest.cpp
index 4be4f8751..b989d889d 100644
--- a/src/selftest/selftest.cpp
+++ b/src/selftest/selftest.cpp
@@ -12,8 +12,6 @@
#include <botan/internal/core_engine.h>
#include <botan/internal/stl_util.h>
-#include <iostream>
-
namespace Botan {
namespace {
@@ -126,18 +124,18 @@ algorithm_kat_detailed(const SCAN_Name& algo_name,
else if(!dec->valid_iv_length(0))
throw Invalid_IV_Length(algo, iv.length());
-#if defined(BOTAN_HAS_AEAD)
+ const std::vector<byte> ad = hex_decode(search_map(vars, std::string("ad")));
- if(AEAD_Filter* enc_aead = dynamic_cast<AEAD_Filter*>(enc))
+ if(!ad.empty())
{
- const std::vector<byte> ad = hex_decode(search_map(vars, std::string("ad")));
-
- enc_aead->set_associated_data(&ad[0], ad.size());
+ if(AEAD_Filter* enc_aead = dynamic_cast<AEAD_Filter*>(enc))
+ {
+ enc_aead->set_associated_data(&ad[0], ad.size());
- if(AEAD_Filter* dec_aead = dynamic_cast<AEAD_Filter*>(dec))
- dec_aead->set_associated_data(&ad[0], ad.size());
+ if(AEAD_Filter* dec_aead = dynamic_cast<AEAD_Filter*>(dec))
+ dec_aead->set_associated_data(&ad[0], ad.size());
+ }
}
-#endif
all_results[provider + " (encrypt)"] = test_filter_kat(enc, input, output);
all_results[provider + " (decrypt)"] = test_filter_kat(dec, output, input);