From a89df27c0f7ded0a673dc84ce0b0e24c6d05e0d0 Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 18 Jul 2003 04:35:30 +0000 Subject: misc changes git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@103 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- modes.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'modes.h') diff --git a/modes.h b/modes.h index e6b30e0..34dd21a 100644 --- a/modes.h +++ b/modes.h @@ -275,19 +275,26 @@ template 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 CipherModeFinalTemplate_ExternalCipher::CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher) +template +void CipherModeFinalTemplate_ExternalCipher::SetCipher(BlockCipher &cipher) { ThrowIfResynchronizable(); m_cipher = &cipher; ResizeBuffers(); } -template CipherModeFinalTemplate_ExternalCipher::CipherModeFinalTemplate_ExternalCipher(BlockCipher &cipher, const byte *iv, int feedbackSize) +template +void CipherModeFinalTemplate_ExternalCipher::SetCipherWithIV(BlockCipher &cipher, const byte *iv, int feedbackSize) { ThrowIfInvalidIV(iv); m_cipher = &cipher; -- cgit v1.2.1