diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-12-10 02:12:23 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-12-10 02:12:23 +0000 |
commit | c3bad1afc1564f3bfac8434d45d6694811139333 (patch) | |
tree | ebfbbcf4dffdf4914b9ce879d3d2c93d3615f7ab /tea.h | |
parent | e553818e00684e8905ede16e53aa490c153b7e7a (diff) | |
download | cryptopp-c3bad1afc1564f3bfac8434d45d6694811139333.tar.gz |
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
Diffstat (limited to 'tea.h')
-rw-r--r-- | tea.h | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -21,7 +21,7 @@ class TEA : public TEA_Info, public BlockCipherDocumentation class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<TEA_Info> { public: - void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length, unsigned int rounds); + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); protected: FixedSizeSecBlock<word32, 4> m_k; @@ -60,7 +60,7 @@ class XTEA : public XTEA_Info, public BlockCipherDocumentation class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<XTEA_Info> { public: - void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length, unsigned int rounds); + void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms); protected: FixedSizeSecBlock<word32, 4> m_k; @@ -97,12 +97,10 @@ class BTEA : public BTEA_Info, public BlockCipherDocumentation class CRYPTOPP_NO_VTABLE Base : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BlockCipher, BTEA_Info>, BTEA_Info>, public BTEA_Info { public: - template <class T> - static inline void CheckedSetKey(T *obj, CipherDir dir, const byte *key, size_t length, const NameValuePairs ¶m) + void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) { - obj->ThrowIfInvalidKeyLength(length); - obj->m_blockSize = param.GetIntValueWithDefault("BlockSize", 60*4); - GetUserKey(BIG_ENDIAN_ORDER, obj->m_k.begin(), 4, key, KEYLENGTH); + m_blockSize = params.GetIntValueWithDefault("BlockSize", 60*4); + GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, key, KEYLENGTH); } unsigned int BlockSize() const {return m_blockSize;} |