diff options
Diffstat (limited to 'src/lib/stream/ofb/ofb.cpp')
-rw-r--r-- | src/lib/stream/ofb/ofb.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/stream/ofb/ofb.cpp b/src/lib/stream/ofb/ofb.cpp index 986e6bf71..37429cd38 100644 --- a/src/lib/stream/ofb/ofb.cpp +++ b/src/lib/stream/ofb/ofb.cpp @@ -5,11 +5,23 @@ * Botan is released under the Simplified BSD License (see license.txt) */ +#include <botan/internal/stream_utils.h> #include <botan/ofb.h> -#include <botan/internal/xor_buf.h> namespace Botan { +BOTAN_REGISTER_NAMED_T(StreamCipher, "OFB", OFB, OFB::make); + +OFB* OFB::make(const Spec& spec) + { + if(spec.algo_name() == "OFB" && spec.arg_count() == 1) + { + if(BlockCipher* c = Algo_Registry<BlockCipher>::global_registry().make(spec.arg(0))) + return new OFB(c); + } + return nullptr; + } + OFB::OFB(BlockCipher* cipher) : m_cipher(cipher), m_buffer(m_cipher->block_size()), |