aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes/ecb/ecb.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-08 22:45:28 +0000
committerlloyd <[email protected]>2008-11-08 22:45:28 +0000
commitdbccddadefdcd9d1f7bd8612d6af4449f4910b1c (patch)
tree0e3a47f70280df03d7bd3b58eaecea6c07c31155 /src/modes/ecb/ecb.h
parentcccd3fafcffa318fa783f857f84b5545028daca2 (diff)
Remove lookup.h use from ECB, CBC, CFB
Diffstat (limited to 'src/modes/ecb/ecb.h')
-rw-r--r--src/modes/ecb/ecb.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/modes/ecb/ecb.h b/src/modes/ecb/ecb.h
index b730a4fd4..d15d2f202 100644
--- a/src/modes/ecb/ecb.h
+++ b/src/modes/ecb/ecb.h
@@ -8,6 +8,7 @@
#include <botan/modebase.h>
#include <botan/mode_pad.h>
+#include <botan/block_cipher.h>
namespace Botan {
@@ -17,7 +18,9 @@ namespace Botan {
class BOTAN_DLL ECB : public BlockCipherMode
{
protected:
- ECB(const std::string&, const std::string&);
+ ECB(BlockCipher* ciph, const BlockCipherModePaddingMethod* pad) :
+ BlockCipherMode(ciph, "ECB", 0), padder(pad) {}
+
std::string name() const;
const BlockCipherModePaddingMethod* padder;
private:
@@ -30,9 +33,14 @@ class BOTAN_DLL ECB : public BlockCipherMode
class BOTAN_DLL ECB_Encryption : public ECB
{
public:
- ECB_Encryption(const std::string&, const std::string&);
- ECB_Encryption(const std::string&, const std::string&,
- const SymmetricKey&);
+ ECB_Encryption(BlockCipher* ciph,
+ const BlockCipherModePaddingMethod* pad) :
+ ECB(ciph, pad) {}
+
+ ECB_Encryption(BlockCipher* ciph,
+ const BlockCipherModePaddingMethod* pad,
+ const SymmetricKey& key) :
+ ECB(ciph, pad) { set_key(key); }
private:
void write(const byte[], u32bit);
void end_msg();
@@ -44,9 +52,14 @@ class BOTAN_DLL ECB_Encryption : public ECB
class BOTAN_DLL ECB_Decryption : public ECB
{
public:
- ECB_Decryption(const std::string&, const std::string&);
- ECB_Decryption(const std::string&, const std::string&,
- const SymmetricKey&);
+ ECB_Decryption(BlockCipher* ciph,
+ const BlockCipherModePaddingMethod* pad) :
+ ECB(ciph, pad) {}
+
+ ECB_Decryption(BlockCipher* ciph,
+ const BlockCipherModePaddingMethod* pad,
+ const SymmetricKey& key) :
+ ECB(ciph, pad) { set_key(key); }
private:
void write(const byte[], u32bit);
void end_msg();