aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/ctr/ctr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/stream/ctr/ctr.cpp')
-rw-r--r--src/lib/stream/ctr/ctr.cpp14
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()),