diff options
author | lloyd <[email protected]> | 2015-01-31 15:30:49 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-01-31 15:30:49 +0000 |
commit | 00c9b3f4834603946065c15b9b2e9fa5e973b979 (patch) | |
tree | b0f82333a1eeab624409db9515e511838f6fa2d6 /src/lib/block/lion | |
parent | 710229be83cdbc061949c61942896b5af9e134d8 (diff) |
Use registry for streams and MACs. Start updating callers.
Diffstat (limited to 'src/lib/block/lion')
-rw-r--r-- | src/lib/block/lion/lion.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/block/lion/lion.cpp b/src/lib/block/lion/lion.cpp index 420b92cdb..44d4d0bed 100644 --- a/src/lib/block/lion/lion.cpp +++ b/src/lib/block/lion/lion.cpp @@ -8,7 +8,6 @@ #include <botan/internal/block_utils.h> #include <botan/lion.h> #include <botan/parsing.h> -#include <botan/libstate.h> namespace Botan { @@ -18,14 +17,13 @@ Lion* make_lion(const BlockCipher::Spec& spec) { if(spec.arg_count_between(2, 3)) { - Algorithm_Factory& af = global_state().algorithm_factory(); - const HashFunction* hash = af.prototype_hash_function(spec.arg(0)); - const StreamCipher* stream_cipher = af.prototype_stream_cipher(spec.arg(1)); + std::unique_ptr<HashFunction> hash(Algo_Registry<HashFunction>::global_registry().make(spec.arg(0))); + std::unique_ptr<StreamCipher> stream(Algo_Registry<StreamCipher>::global_registry().make(spec.arg(1))); - if(hash && stream_cipher) + if(hash && stream) { const size_t block_size = spec.arg_as_integer(2, 1024); - return new Lion(hash->clone(), stream_cipher->clone(), block_size); + return new Lion(hash.release(), stream.release(), block_size); } } return nullptr; |