aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/ecb
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-31 15:30:49 +0000
committerlloyd <[email protected]>2015-01-31 15:30:49 +0000
commit00c9b3f4834603946065c15b9b2e9fa5e973b979 (patch)
treeb0f82333a1eeab624409db9515e511838f6fa2d6 /src/lib/modes/ecb
parent710229be83cdbc061949c61942896b5af9e134d8 (diff)
Use registry for streams and MACs. Start updating callers.
Diffstat (limited to 'src/lib/modes/ecb')
-rw-r--r--src/lib/modes/ecb/ecb.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/modes/ecb/ecb.cpp b/src/lib/modes/ecb/ecb.cpp
index 1db272d12..6318671ca 100644
--- a/src/lib/modes/ecb/ecb.cpp
+++ b/src/lib/modes/ecb/ecb.cpp
@@ -13,11 +13,10 @@ namespace Botan {
template<typename T>
Transform* make_ecb_mode(const Transform::Spec& spec)
{
- Algorithm_Factory& af = global_state().algorithm_factory();
- const BlockCipher* bc = af.prototype_block_cipher(spec.arg(0));
- BlockCipherModePaddingMethod* pad = get_bc_pad(spec.arg(1, "NoPadding"));
+ std::unique_ptr<BlockCipher> bc(Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0)));
+ std::unique_ptr<BlockCipherModePaddingMethod> pad(get_bc_pad(spec.arg(1, "NoPadding")));
if(bc && pad)
- return new T(bc->clone(), pad);
+ return new T(bc.release(), pad.release());
return nullptr;
}