summaryrefslogtreecommitdiff
path: root/3way.cpp
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 /3way.cpp
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 '3way.cpp')
-rw-r--r--3way.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/3way.cpp b/3way.cpp
index 0b7d4f2..725b682 100644
--- a/3way.cpp
+++ b/3way.cpp
@@ -61,17 +61,16 @@ static inline word32 reverseBits(word32 a)
pi_gamma_pi(a0, a1, a2); \
}
-void ThreeWay::Base::UncheckedSetKey(CipherDir dir, const byte *uk, unsigned int length, unsigned int r)
+void ThreeWay::Base::UncheckedSetKey(const byte *uk, unsigned int length, const NameValuePairs &params)
{
AssertValidKeyLength(length);
- AssertValidRounds(r);
- m_rounds = r;
+ m_rounds = GetRoundsAndThrowIfInvalid(params, this);
for (unsigned int i=0; i<3; i++)
m_k[i] = (word32)uk[4*i+3] | ((word32)uk[4*i+2]<<8) | ((word32)uk[4*i+1]<<16) | ((word32)uk[4*i]<<24);
- if (dir == DECRYPTION)
+ if (!IsForwardTransformation())
{
theta(m_k[0], m_k[1], m_k[2]);
mu(m_k[0], m_k[1], m_k[2]);