aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/cipher_mode.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-21 14:59:01 -0400
committerJack Lloyd <[email protected]>2015-09-21 14:59:01 -0400
commit04319af23bf8ed467b17f9b74c814343e051ab6b (patch)
tree630d1a0cc931e77e7e1f07319e5cf89d00af4458 /src/lib/modes/cipher_mode.cpp
parent408ea0a9b8ed0f575f8ee26891473920b42ef026 (diff)
Remove use of lookup.h in favor of new T::create API.
Diffstat (limited to 'src/lib/modes/cipher_mode.cpp')
-rw-r--r--src/lib/modes/cipher_mode.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/modes/cipher_mode.cpp b/src/lib/modes/cipher_mode.cpp
index 262c41434..27ee26327 100644
--- a/src/lib/modes/cipher_mode.cpp
+++ b/src/lib/modes/cipher_mode.cpp
@@ -7,7 +7,6 @@
#include <botan/cipher_mode.h>
#include <botan/stream_mode.h>
-#include <botan/lookup.h>
#include <botan/internal/mode_utils.h>
#include <sstream>
@@ -34,7 +33,7 @@ namespace Botan {
template<typename T>
Transform* make_ecb_mode(const Transform::Spec& spec)
{
- std::unique_ptr<BlockCipher> bc(get_block_cipher(spec.arg(0)));
+ std::unique_ptr<BlockCipher> bc(BlockCipher::create(spec.arg(0)));
std::unique_ptr<BlockCipherModePaddingMethod> pad(get_bc_pad(spec.arg(1, "NoPadding")));
if(bc && pad)
return new T(bc.release(), pad.release());
@@ -50,7 +49,7 @@ BOTAN_REGISTER_TRANSFORM(ECB_Decryption, make_ecb_mode<ECB_Decryption>);
template<typename CBC_T, typename CTS_T>
Transform* make_cbc_mode(const Transform::Spec& spec)
{
- std::unique_ptr<BlockCipher> bc(get_block_cipher(spec.arg(0)));
+ std::unique_ptr<BlockCipher> bc(BlockCipher::create(spec.arg(0)));
if(bc)
{
@@ -131,8 +130,8 @@ Cipher_Mode* get_cipher_mode(const std::string& algo_spec, Cipher_Dir direction)
return cipher;
}
- if(StreamCipher* stream_cipher = get_stream_cipher(mode_name, provider))
- return new Stream_Cipher_Mode(stream_cipher);
+ if(auto sc = StreamCipher::create(mode_name, provider))
+ return new Stream_Cipher_Mode(sc.release());
return nullptr;
}