aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/cbc
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/cbc
parent710229be83cdbc061949c61942896b5af9e134d8 (diff)
Use registry for streams and MACs. Start updating callers.
Diffstat (limited to 'src/lib/modes/cbc')
-rw-r--r--src/lib/modes/cbc/cbc.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/modes/cbc/cbc.cpp b/src/lib/modes/cbc/cbc.cpp
index e54553d16..1fb27f2e0 100644
--- a/src/lib/modes/cbc/cbc.cpp
+++ b/src/lib/modes/cbc/cbc.cpp
@@ -14,17 +14,16 @@ namespace Botan {
template<typename CBC_T, typename CTS_T>
Transform* make_cbc_mode(const Transform::Spec& spec)
{
- Algorithm_Factory& af = global_state().algorithm_factory();
- const BlockCipher* bc = af.prototype_block_cipher(spec.arg(0));
+ std::unique_ptr<BlockCipher> bc(Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0)));
if(bc)
{
const std::string padding = spec.arg(1, "PKCS7");
if(padding == "CTS")
- return new CTS_T(bc->clone());
+ return new CTS_T(bc.release());
else
- return new CBC_T(bc->clone(), get_bc_pad(padding));
+ return new CBC_T(bc.release(), get_bc_pad(padding));
}
return nullptr;