diff options
author | lloyd <[email protected]> | 2008-11-08 22:45:28 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-08 22:45:28 +0000 |
commit | dbccddadefdcd9d1f7bd8612d6af4449f4910b1c (patch) | |
tree | 0e3a47f70280df03d7bd3b58eaecea6c07c31155 /src/modes/cfb | |
parent | cccd3fafcffa318fa783f857f84b5545028daca2 (diff) |
Remove lookup.h use from ECB, CBC, CFB
Diffstat (limited to 'src/modes/cfb')
-rw-r--r-- | src/modes/cfb/cfb.cpp | 21 | ||||
-rw-r--r-- | src/modes/cfb/cfb.h | 8 |
2 files changed, 12 insertions, 17 deletions
diff --git a/src/modes/cfb/cfb.cpp b/src/modes/cfb/cfb.cpp index 60599464b..f5eb4cecf 100644 --- a/src/modes/cfb/cfb.cpp +++ b/src/modes/cfb/cfb.cpp @@ -4,7 +4,6 @@ *************************************************/ #include <botan/cfb.h> -#include <botan/lookup.h> #include <botan/parsing.h> #include <botan/xor_buf.h> #include <algorithm> @@ -29,10 +28,9 @@ void check_feedback(u32bit BLOCK_SIZE, u32bit FEEDBACK_SIZE, u32bit bits, /************************************************* * CFB Encryption Constructor * *************************************************/ -CFB_Encryption::CFB_Encryption(const std::string& cipher_name, +CFB_Encryption::CFB_Encryption(BlockCipher* ciph, u32bit fback_bits) : - BlockCipherMode(get_block_cipher(cipher_name), - "CFB", block_size_of(cipher_name), 1), + BlockCipherMode(ciph, "CFB", ciph->BLOCK_SIZE, 1), FEEDBACK_SIZE(fback_bits ? fback_bits / 8: BLOCK_SIZE) { check_feedback(BLOCK_SIZE, FEEDBACK_SIZE, fback_bits, name()); @@ -41,12 +39,11 @@ CFB_Encryption::CFB_Encryption(const std::string& cipher_name, /************************************************* * CFB Encryption Constructor * *************************************************/ -CFB_Encryption::CFB_Encryption(const std::string& cipher_name, +CFB_Encryption::CFB_Encryption(BlockCipher* ciph, const SymmetricKey& key, const InitializationVector& iv, u32bit fback_bits) : - BlockCipherMode(get_block_cipher(cipher_name), - "CFB", block_size_of(cipher_name), 1), + BlockCipherMode(ciph, "CFB", ciph->BLOCK_SIZE, 1), FEEDBACK_SIZE(fback_bits ? fback_bits / 8: BLOCK_SIZE) { check_feedback(BLOCK_SIZE, FEEDBACK_SIZE, fback_bits, name()); @@ -87,10 +84,9 @@ void CFB_Encryption::feedback() /************************************************* * CFB Decryption Constructor * *************************************************/ -CFB_Decryption::CFB_Decryption(const std::string& cipher_name, +CFB_Decryption::CFB_Decryption(BlockCipher* ciph, u32bit fback_bits) : - BlockCipherMode(get_block_cipher(cipher_name), - "CFB", block_size_of(cipher_name), 1), + BlockCipherMode(ciph, "CFB", ciph->BLOCK_SIZE, 1), FEEDBACK_SIZE(fback_bits ? fback_bits / 8 : BLOCK_SIZE) { check_feedback(BLOCK_SIZE, FEEDBACK_SIZE, fback_bits, name()); @@ -99,12 +95,11 @@ CFB_Decryption::CFB_Decryption(const std::string& cipher_name, /************************************************* * CFB Decryption Constructor * *************************************************/ -CFB_Decryption::CFB_Decryption(const std::string& cipher_name, +CFB_Decryption::CFB_Decryption(BlockCipher* ciph, const SymmetricKey& key, const InitializationVector& iv, u32bit fback_bits) : - BlockCipherMode(get_block_cipher(cipher_name), - "CFB", block_size_of(cipher_name), 1), + BlockCipherMode(ciph, "CFB", ciph->BLOCK_SIZE, 1), FEEDBACK_SIZE(fback_bits ? fback_bits / 8 : BLOCK_SIZE) { check_feedback(BLOCK_SIZE, FEEDBACK_SIZE, fback_bits, name()); diff --git a/src/modes/cfb/cfb.h b/src/modes/cfb/cfb.h index e8133bcf4..dad7ece13 100644 --- a/src/modes/cfb/cfb.h +++ b/src/modes/cfb/cfb.h @@ -16,8 +16,8 @@ namespace Botan { class BOTAN_DLL CFB_Encryption : public BlockCipherMode { public: - CFB_Encryption(const std::string&, u32bit = 0); - CFB_Encryption(const std::string&, const SymmetricKey&, + CFB_Encryption(BlockCipher*, u32bit = 0); + CFB_Encryption(BlockCipher*, const SymmetricKey&, const InitializationVector&, u32bit = 0); private: void write(const byte[], u32bit); @@ -31,8 +31,8 @@ class BOTAN_DLL CFB_Encryption : public BlockCipherMode class BOTAN_DLL CFB_Decryption : public BlockCipherMode { public: - CFB_Decryption(const std::string&, u32bit = 0); - CFB_Decryption(const std::string&, const SymmetricKey&, + CFB_Decryption(BlockCipher*, u32bit = 0); + CFB_Decryption(BlockCipher*, const SymmetricKey&, const InitializationVector&, u32bit = 0); private: void write(const byte[], u32bit); |