aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-08-15 20:46:15 +0000
committerlloyd <[email protected]>2013-08-15 20:46:15 +0000
commit7328d76b78c3c923c11cc01aa5cf8e5498ea02ff (patch)
treeb62a69987d18d0b8d010329f11f4a72cf0b3ecce /src/engine
parent10bab015381aceecdf37bc7c7c325e014f2da676 (diff)
Convert CTS mode to Transformation API
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/core_engine/core_modes.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/engine/core_engine/core_modes.cpp b/src/engine/core_engine/core_modes.cpp
index e949d5f9b..aa9080c2d 100644
--- a/src/engine/core_engine/core_modes.cpp
+++ b/src/engine/core_engine/core_modes.cpp
@@ -12,10 +12,6 @@
#include <botan/mode_pad.h>
#include <memory>
-#if defined(BOTAN_HAS_CTS)
- #include <botan/cts.h>
-#endif
-
#if defined(BOTAN_HAS_MODE_CFB)
#include <botan/cfb.h>
#endif
@@ -117,19 +113,15 @@ Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher,
if(mode == "CBC")
{
+#if defined(BOTAN_HAS_MODE_CBC)
if(padding == "CTS")
{
-#if defined(BOTAN_HAS_CTS)
if(direction == ENCRYPTION)
- return new CTS_Encryption(block_cipher->clone());
+ return new Transformation_Filter(new CTS_Encryption(block_cipher->clone()));
else
- return new CTS_Decryption(block_cipher->clone());
-#else
- return nullptr;
-#endif
+ return new Transformation_Filter(new CTS_Decryption(block_cipher->clone()));
}
-#if defined(BOTAN_HAS_MODE_CBC)
if(direction == ENCRYPTION)
return new Transformation_Filter(
new CBC_Encryption(block_cipher->clone(), get_bc_pad(padding, "PKCS7")));