aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/engine/def_engine/def_mode.cpp2
-rw-r--r--src/modes/ctr/ctr.cpp1
-rw-r--r--src/modes/ofb/ofb.cpp11
-rw-r--r--src/modes/ofb/ofb.h13
4 files changed, 13 insertions, 14 deletions
diff --git a/src/engine/def_engine/def_mode.cpp b/src/engine/def_engine/def_mode.cpp
index 88d6639eb..2d4701796 100644
--- a/src/engine/def_engine/def_mode.cpp
+++ b/src/engine/def_engine/def_mode.cpp
@@ -91,7 +91,7 @@ Keyed_Filter* Default_Engine::get_cipher(const std::string& algo_spec,
if(mode == "OFB")
{
#if defined(BOTAN_HAS_OFB)
- return new OFB(cipher);
+ return new OFB(get_block_cipher(cipher));
#else
return 0;
#endif
diff --git a/src/modes/ctr/ctr.cpp b/src/modes/ctr/ctr.cpp
index e61c8746c..a17343df1 100644
--- a/src/modes/ctr/ctr.cpp
+++ b/src/modes/ctr/ctr.cpp
@@ -4,7 +4,6 @@
*************************************************/
#include <botan/ctr.h>
-#include <botan/lookup.h>
#include <botan/xor_buf.h>
#include <algorithm>
diff --git a/src/modes/ofb/ofb.cpp b/src/modes/ofb/ofb.cpp
index 8162f97ba..6f88a9bfd 100644
--- a/src/modes/ofb/ofb.cpp
+++ b/src/modes/ofb/ofb.cpp
@@ -4,7 +4,6 @@
*************************************************/
#include <botan/ofb.h>
-#include <botan/lookup.h>
#include <botan/xor_buf.h>
#include <algorithm>
@@ -13,19 +12,17 @@ namespace Botan {
/*************************************************
* OFB Constructor *
*************************************************/
-OFB::OFB(const std::string& cipher_name) :
- BlockCipherMode(get_block_cipher(cipher_name),
- "OFB", block_size_of(cipher_name), 2)
+OFB::OFB(BlockCipher* ciph) :
+ BlockCipherMode(ciph, "OFB", ciph->BLOCK_SIZE, 2)
{
}
/*************************************************
* OFB Constructor *
*************************************************/
-OFB::OFB(const std::string& cipher_name, const SymmetricKey& key,
+OFB::OFB(BlockCipher* ciph, const SymmetricKey& key,
const InitializationVector& iv) :
- BlockCipherMode(get_block_cipher(cipher_name),
- "OFB", block_size_of(cipher_name), 2)
+ BlockCipherMode(ciph, "OFB", ciph->BLOCK_SIZE, 2)
{
set_key(key);
set_iv(iv);
diff --git a/src/modes/ofb/ofb.h b/src/modes/ofb/ofb.h
index 3bf6f9883..53ec695bf 100644
--- a/src/modes/ofb/ofb.h
+++ b/src/modes/ofb/ofb.h
@@ -3,10 +3,11 @@
* (C) 1999-2007 Jack Lloyd *
*************************************************/
-#ifndef BOTAN_OFB_H__
-#define BOTAN_OFB_H__
+#ifndef BOTAN_OUTPUT_FEEDBACK_MODE_H__
+#define BOTAN_OUTPUT_FEEDBACK_MODE_H__
#include <botan/modebase.h>
+#include <botan/block_cipher.h>
namespace Botan {
@@ -16,9 +17,11 @@ namespace Botan {
class BOTAN_DLL OFB : public BlockCipherMode
{
public:
- OFB(const std::string&);
- OFB(const std::string&,
- const SymmetricKey&, const InitializationVector&);
+ OFB(BlockCipher* cipher);
+
+ OFB(BlockCipher* cipher,
+ const SymmetricKey& key,
+ const InitializationVector& iv);
private:
void write(const byte[], u32bit);
};