summaryrefslogtreecommitdiff
path: root/tea.h
diff options
context:
space:
mode:
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;}