aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes/aead/aead.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/aead/aead.cpp')
-rw-r--r--src/modes/aead/aead.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/modes/aead/aead.cpp b/src/modes/aead/aead.cpp
index d913c7c3a..26a7091fd 100644
--- a/src/modes/aead/aead.cpp
+++ b/src/modes/aead/aead.cpp
@@ -20,6 +20,10 @@
#include <botan/gcm.h>
#endif
+#if defined(BOTAN_HAS_AEAD_SIV)
+ #include <botan/siv.h>
+#endif
+
#if defined(BOTAN_HAS_AEAD_OCB)
#include <botan/ocb.h>
#endif
@@ -59,7 +63,7 @@ AEAD_Mode* get_aead(const std::string& algo_spec, Cipher_Dir direction)
return new CCM_Decryption(cipher->clone(), 8, 3);
}
- if(mode_name == "CCM")
+ if(mode_name == "CCM" || mode_name == "CCM-8")
{
const size_t L = (mode_info.size() > 2) ? to_u32bit(mode_info[2]) : 3;
@@ -80,6 +84,17 @@ AEAD_Mode* get_aead(const std::string& algo_spec, Cipher_Dir direction)
}
#endif
+#if defined(BOTAN_HAS_AEAD_SIV)
+ if(mode_name == "SIV")
+ {
+ BOTAN_ASSERT(tag_size == 16, "Valid tag size for SIV");
+ if(direction == ENCRYPTION)
+ return new SIV_Encryption(cipher->clone());
+ else
+ return new SIV_Decryption(cipher->clone());
+ }
+#endif
+
#if defined(BOTAN_HAS_AEAD_GCM)
if(mode_name == "GCM")
{