aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/cbc
diff options
context:
space:
mode:
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;