aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/mode_utils.h
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/mode_utils.h
parent408ea0a9b8ed0f575f8ee26891473920b42ef026 (diff)
Remove use of lookup.h in favor of new T::create API.
Diffstat (limited to 'src/lib/modes/mode_utils.h')
-rw-r--r--src/lib/modes/mode_utils.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/modes/mode_utils.h b/src/lib/modes/mode_utils.h
index b93884206..a61c22a4f 100644
--- a/src/lib/modes/mode_utils.h
+++ b/src/lib/modes/mode_utils.h
@@ -10,7 +10,6 @@
#include <botan/cipher_mode.h>
#include <botan/internal/algo_registry.h>
-#include <botan/lookup.h>
#include <botan/block_cipher.h>
#include <botan/loadstor.h>
#include <botan/internal/rounding.h>
@@ -22,18 +21,18 @@ namespace Botan {
template<typename T>
T* make_block_cipher_mode(const Transform::Spec& spec)
{
- if(BlockCipher* bc = get_block_cipher(spec.arg(0)))
- return new T(bc);
+ if(std::unique_ptr<BlockCipher> bc = BlockCipher::create(spec.arg(0)))
+ return new T(bc.release());
return nullptr;
}
template<typename T, size_t LEN1>
T* make_block_cipher_mode_len(const Transform::Spec& spec)
{
- if(BlockCipher* bc = get_block_cipher(spec.arg(0)))
+ if(std::unique_ptr<BlockCipher> bc = BlockCipher::create(spec.arg(0)))
{
const size_t len1 = spec.arg_as_integer(1, LEN1);
- return new T(bc, len1);
+ return new T(bc.release(), len1);
}
return nullptr;
@@ -42,11 +41,11 @@ T* make_block_cipher_mode_len(const Transform::Spec& spec)
template<typename T, size_t LEN1, size_t LEN2>
T* make_block_cipher_mode_len2(const Transform::Spec& spec)
{
- if(BlockCipher* bc = get_block_cipher(spec.arg(0)))
+ if(std::unique_ptr<BlockCipher> bc = BlockCipher::create(spec.arg(0)))
{
const size_t len1 = spec.arg_as_integer(1, LEN1);
const size_t len2 = spec.arg_as_integer(2, LEN2);
- return new T(bc, len1, len2);
+ return new T(bc.release(), len1, len2);
}
return nullptr;