From 1a93a9c7e73becbfce821705b387ce3cf660dad0 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sat, 8 Nov 2008 22:49:01 +0000 Subject: Remove lookup.h from CTS mode --- src/modes/cts/cts.cpp | 46 ---------------------------------------------- src/modes/cts/cts.h | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 52 deletions(-) (limited to 'src/modes/cts') diff --git a/src/modes/cts/cts.cpp b/src/modes/cts/cts.cpp index 0bce248b5..12756eb58 100644 --- a/src/modes/cts/cts.cpp +++ b/src/modes/cts/cts.cpp @@ -10,28 +10,6 @@ namespace Botan { -/************************************************* -* CTS Encryption Constructor * -*************************************************/ -CTS_Encryption::CTS_Encryption(const std::string& cipher_name) : - BlockCipherMode(get_block_cipher(cipher_name), - "CTS", block_size_of(cipher_name), 0, 2) - { - } - -/************************************************* -* CTS Encryption Constructor * -*************************************************/ -CTS_Encryption::CTS_Encryption(const std::string& cipher_name, - const SymmetricKey& key, - const InitializationVector& iv) : - BlockCipherMode(get_block_cipher(cipher_name), - "CTS", block_size_of(cipher_name), 0, 2) - { - set_key(key); - set_iv(iv); - } - /************************************************* * Encrypt a block * *************************************************/ @@ -91,30 +69,6 @@ void CTS_Encryption::end_msg() send(cn, position - BLOCK_SIZE); } -/************************************************* -* CTS Decryption Constructor * -*************************************************/ -CTS_Decryption::CTS_Decryption(const std::string& cipher_name) : - BlockCipherMode(get_block_cipher(cipher_name), - "CTS", block_size_of(cipher_name), 0, 2) - { - temp.create(BLOCK_SIZE); - } - -/************************************************* -* CTS Decryption Constructor * -*************************************************/ -CTS_Decryption::CTS_Decryption(const std::string& cipher_name, - const SymmetricKey& key, - const InitializationVector& iv) : - BlockCipherMode(get_block_cipher(cipher_name), - "CTS", block_size_of(cipher_name), 0, 2) - { - temp.create(BLOCK_SIZE); - set_key(key); - set_iv(iv); - } - /************************************************* * Decrypt a block * *************************************************/ diff --git a/src/modes/cts/cts.h b/src/modes/cts/cts.h index 6a07c4eb2..57582d8de 100644 --- a/src/modes/cts/cts.h +++ b/src/modes/cts/cts.h @@ -7,6 +7,7 @@ #define BOTAN_CTS_H__ #include +#include namespace Botan { @@ -16,9 +17,14 @@ namespace Botan { class BOTAN_DLL CTS_Encryption : public BlockCipherMode { public: - CTS_Encryption(const std::string&); - CTS_Encryption(const std::string&, - const SymmetricKey&, const InitializationVector&); + CTS_Encryption(BlockCipher* ciph) : + BlockCipherMode(ciph, "CTS", ciph->BLOCK_SIZE, 0, 2) {} + + CTS_Encryption(BlockCipher* ciph, + const SymmetricKey& key, + const InitializationVector& iv) : + BlockCipherMode(ciph, "CTS", ciph->BLOCK_SIZE, 0, 2) + { set_key(key); set_iv(iv); } private: void write(const byte[], u32bit); void end_msg(); @@ -31,9 +37,15 @@ class BOTAN_DLL CTS_Encryption : public BlockCipherMode class BOTAN_DLL CTS_Decryption : public BlockCipherMode { public: - CTS_Decryption(const std::string&); - CTS_Decryption(const std::string&, - const SymmetricKey&, const InitializationVector&); + CTS_Decryption(BlockCipher* ciph) : + BlockCipherMode(ciph, "CTS", ciph->BLOCK_SIZE, 0, 2) + { temp.create(BLOCK_SIZE); } + + CTS_Decryption(BlockCipher* ciph, + const SymmetricKey& key, + const InitializationVector& iv) : + BlockCipherMode(ciph, "CTS", ciph->BLOCK_SIZE, 0, 2) + { set_key(key); set_iv(iv); temp.create(BLOCK_SIZE); } private: void write(const byte[], u32bit); void end_msg(); -- cgit v1.2.3