From f05ea58bb369988a61438411539ea955e0adf8c2 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 --- tea.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tea.cpp') diff --git a/tea.cpp b/tea.cpp index a9710535..60921d4b 100644 --- a/tea.cpp +++ b/tea.cpp @@ -9,12 +9,12 @@ NAMESPACE_BEGIN(CryptoPP) static const word32 DELTA = 0x9e3779b9; typedef BlockGetAndPut Block; -void TEA::Base::UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length, unsigned int rounds) +void TEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) { AssertValidKeyLength(length); GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, userKey, KEYLENGTH); - m_limit = rounds * DELTA; + m_limit = GetRoundsAndThrowIfInvalid(params, this) * DELTA; } void TEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const @@ -49,12 +49,12 @@ void TEA::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byt Block::Put(xorBlock, outBlock)(y)(z); } -void XTEA::Base::UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length, unsigned int rounds) +void XTEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms) { AssertValidKeyLength(length); GetUserKey(BIG_ENDIAN_ORDER, m_k.begin(), 4, userKey, KEYLENGTH); - m_limit = rounds * DELTA; + m_limit = GetRoundsAndThrowIfInvalid(params, this) * DELTA; } void XTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const -- cgit v1.2.1