summaryrefslogtreecommitdiff
path: root/modes.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-18 04:35:30 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-18 04:35:30 +0000
commita89df27c0f7ded0a673dc84ce0b0e24c6d05e0d0 (patch)
treea25c153b42dc3f510a7981a031bd04dfa0a7a712 /modes.h
parent656db5504c8c656d3981fed232da44b2f28b1feb (diff)
downloadcryptopp-a89df27c0f7ded0a673dc84ce0b0e24c6d05e0d0.tar.gz
misc changes
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@103 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'modes.h')
-rw-r--r--modes.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/modes.h b/modes.h
index e6b30e0..34dd21a 100644
--- a/modes.h
+++ b/modes.h
@@ -275,19 +275,26 @@ template <class BASE>
class CipherModeFinalTemplate_ExternalCipher : public BASE
{
public:
- CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher);
-
- CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher, const byte *iv, int feedbackSize = 0);
+ CipherModeFinalTemplate_ExternalCipher() {}
+ CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher)
+ {SetCipher(cipher);}
+ CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher, const byte *iv, int feedbackSize = 0)
+ {SetCipherWithIV(cipher, iv, feedbackSize);}
+
+ void SetCipher(BlockCipher &cipher);
+ void SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize = 0);
};
-template <class BASE> CipherModeFinalTemplate_ExternalCipher<BASE>::CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher)
+template <class BASE>
+void CipherModeFinalTemplate_ExternalCipher<BASE>::SetCipher(BlockCipher &cipher)
{
ThrowIfResynchronizable();
m_cipher = &cipher;
ResizeBuffers();
}
-template <class BASE> CipherModeFinalTemplate_ExternalCipher<BASE>::CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher, const byte *iv, int feedbackSize)
+template <class BASE>
+void CipherModeFinalTemplate_ExternalCipher<BASE>::SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize)
{
ThrowIfInvalidIV(iv);
m_cipher = &cipher;