aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-04-16 22:48:52 +0000
committerlloyd <[email protected]>2009-04-16 22:48:52 +0000
commit967bf93208e061eb794ec0e368dec3c33a80615c (patch)
tree760919fe7f84c5f048d1de580b5228f35800918e /src/engine
parent07ffeeee0e4fd3cd2ccf4b3267fabef20eee2964 (diff)
Add XTS mode, from IEEE P1619
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/def_engine/def_mode.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/def_engine/def_mode.cpp b/src/engine/def_engine/def_mode.cpp
index a61683f93..2b093a0a3 100644
--- a/src/engine/def_engine/def_mode.cpp
+++ b/src/engine/def_engine/def_mode.cpp
@@ -40,6 +40,10 @@
#include <botan/eax.h>
#endif
+#if defined(BOTAN_HAS_XTS)
+ #include <botan/xts.h>
+#endif
+
namespace Botan {
namespace {
@@ -188,6 +192,16 @@ Keyed_Filter* Default_Engine::get_cipher(const std::string& algo_spec,
}
#endif
+#if defined(BOTAN_HAS_XTS)
+ if(mode == "XTS")
+ {
+ if(direction == ENCRYPTION)
+ return new XTS_Encryption(block_cipher->clone());
+ else
+ return new XTS_Decryption(block_cipher->clone());
+ }
+#endif
+
throw Algorithm_Not_Found("get_mode: " + cipher_name + "/" +
mode + "/" + padding);
}