From c3bad1afc1564f3bfac8434d45d6694811139333 Mon Sep 17 00:00:00 2001 From: weidai Date: Sun, 10 Dec 2006 02:12:23 +0000 Subject: port to GCC 4, reorganize implementations of SetKey git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@248 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- modes.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'modes.h') diff --git a/modes.h b/modes.h index c4e875e..04e5016 100644 --- a/modes.h +++ b/modes.h @@ -37,8 +37,6 @@ public: size_t GetValidKeyLength(size_t n) const {return m_cipher->GetValidKeyLength(n);} bool IsValidKeyLength(size_t n) const {return m_cipher->IsValidKeyLength(n);} - void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms = g_nullNameValuePairs); - unsigned int OptimalDataAlignment() const {return BlockSize();} unsigned int IVSize() const {return BlockSize();} @@ -56,7 +54,6 @@ protected: { m_register.New(m_cipher->BlockSize()); } - virtual void UncheckedSetKey(const NameValuePairs ¶ms, const byte *key, unsigned int length, const byte *iv) =0; BlockCipher *m_cipher; SecByteBlock m_register; @@ -171,7 +168,7 @@ private: class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockOrientedCipherModeBase : public CipherModeBase { public: - void UncheckedSetKey(const NameValuePairs ¶ms, const byte *key, unsigned int length, const byte *iv); + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms); unsigned int MandatoryBlockSize() const {return BlockSize();} bool IsRandomAccess() const {return false;} bool IsSelfInverting() const {return false;} @@ -225,9 +222,9 @@ public: static const char * CRYPTOPP_API StaticAlgorithmName() {return "CBC/CTS";} protected: - void UncheckedSetKey(const NameValuePairs ¶ms, const byte *key, unsigned int length, const byte *iv) + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) { - CBC_Encryption::UncheckedSetKey(params, key, length, iv); + CBC_Encryption::UncheckedSetKey(key, length, params); m_stolenIV = params.GetValueWithDefault(Name::StolenIV(), (byte *)NULL); } -- cgit v1.2.1