aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/mode_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/modes/mode_utils.h')
-rw-r--r--src/lib/modes/mode_utils.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/lib/modes/mode_utils.h b/src/lib/modes/mode_utils.h
index 0333403a3..70c996428 100644
--- a/src/lib/modes/mode_utils.h
+++ b/src/lib/modes/mode_utils.h
@@ -11,7 +11,6 @@
#include <botan/cipher_mode.h>
#include <botan/algo_registry.h>
#include <botan/block_cipher.h>
-#include <botan/libstate.h>
#include <botan/loadstor.h>
#include <botan/internal/xor_buf.h>
#include <botan/internal/rounding.h>
@@ -23,9 +22,7 @@ namespace Botan {
template<typename T>
T* make_block_cipher_mode(const Transform::Spec& spec)
{
- Algorithm_Factory& af = global_state().algorithm_factory();
-
- if(const BlockCipher* bc = af.prototype_block_cipher(spec.arg(0)))
+ if(BlockCipher* bc = Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0)))
return new T(bc->clone());
return nullptr;
}
@@ -33,9 +30,7 @@ T* make_block_cipher_mode(const Transform::Spec& spec)
template<typename T, size_t LEN1>
T* make_block_cipher_mode_len(const Transform::Spec& spec)
{
- Algorithm_Factory& af = global_state().algorithm_factory();
-
- if(const BlockCipher* bc = af.prototype_block_cipher(spec.arg(0)))
+ if(BlockCipher* bc = Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0)))
{
const size_t len1 = spec.arg_as_integer(1, LEN1);
return new T(bc->clone(), len1);
@@ -47,9 +42,7 @@ 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)
{
- Algorithm_Factory& af = global_state().algorithm_factory();
-
- if(const BlockCipher* bc = af.prototype_block_cipher(spec.arg(0)))
+ if(BlockCipher* bc = Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0)))
{
const size_t len1 = spec.arg_as_integer(1, LEN1);
const size_t len2 = spec.arg_as_integer(2, LEN2);