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/stream/ctr/ctr.cpp | |
parent | 710229be83cdbc061949c61942896b5af9e134d8 (diff) |
Use registry for streams and MACs. Start updating callers.
Diffstat (limited to 'src/lib/stream/ctr/ctr.cpp')
-rw-r--r-- | src/lib/stream/ctr/ctr.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/stream/ctr/ctr.cpp b/src/lib/stream/ctr/ctr.cpp index 27118ee64..b6057a2a8 100644 --- a/src/lib/stream/ctr/ctr.cpp +++ b/src/lib/stream/ctr/ctr.cpp @@ -5,11 +5,23 @@ * Botan is released under the Simplified BSD License (see license.txt) */ +#include <botan/internal/stream_utils.h> #include <botan/ctr.h> -#include <botan/internal/xor_buf.h> namespace Botan { +BOTAN_REGISTER_NAMED_T(StreamCipher, "CTR-BE", CTR_BE, CTR_BE::make); + +CTR_BE* CTR_BE::make(const Spec& spec) + { + if(spec.algo_name() == "CTR-BE" && spec.arg_count() == 1) + { + if(BlockCipher* c = Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0))) + return new CTR_BE(c); + } + return nullptr; + } + CTR_BE::CTR_BE(BlockCipher* ciph) : m_cipher(ciph), m_counter(256 * m_cipher->block_size()), |