aboutsummaryrefslogtreecommitdiffstats
path: root/lib/modes
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-10 00:08:13 +0000
committerlloyd <[email protected]>2014-01-10 00:08:13 +0000
commit57789bdfc55061002b2727d0b32587612829a37c (patch)
tree99f36631b4ec50c5187a1b0a7c256b99182373ad /lib/modes
parent94968c917407a63d888fd3eb4d02491f60de6ebc (diff)
Split up test vectors into per-algo files and app into botan-test for
the tests and botan for everything else.
Diffstat (limited to 'lib/modes')
-rw-r--r--lib/modes/aead/aead.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/modes/aead/aead.cpp b/lib/modes/aead/aead.cpp
index 26a7091fd..da860c26a 100644
--- a/lib/modes/aead/aead.cpp
+++ b/lib/modes/aead/aead.cpp
@@ -42,17 +42,18 @@ AEAD_Mode* get_aead(const std::string& algo_spec, Cipher_Dir direction)
return nullptr;
const std::string cipher_name = algo_parts[0];
+ const BlockCipher* cipher = af.prototype_block_cipher(cipher_name);
+ if(!cipher)
+ return nullptr;
+
const std::vector<std::string> mode_info = parse_algorithm_name(algo_parts[1]);
if(mode_info.empty())
return nullptr;
const std::string mode_name = mode_info[0];
- const size_t tag_size = (mode_info.size() > 1) ? to_u32bit(mode_info[1]) : 16;
- const BlockCipher* cipher = af.prototype_block_cipher(cipher_name);
- if(!cipher)
- return nullptr;
+ const size_t tag_size = (mode_info.size() > 1) ? to_u32bit(mode_info[1]) : cipher->block_size();
#if defined(BOTAN_HAS_AEAD_CCM)
if(mode_name == "CCM-8")