summaryrefslogtreecommitdiff
path: root/tea.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-10 02:12:23 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-10 02:12:23 +0000
commitc3bad1afc1564f3bfac8434d45d6694811139333 (patch)
treeebfbbcf4dffdf4914b9ce879d3d2c93d3615f7ab /tea.h
parente553818e00684e8905ede16e53aa490c153b7e7a (diff)
downloadcryptopp-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.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/tea.h b/tea.h
index c05c98a..d8ddded 100644
--- a/tea.h
+++ b/tea.h
@@ -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 &params);
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 &params);
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 &param)
+ void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
{
- 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;}