summaryrefslogtreecommitdiff
path: root/shark.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 /shark.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 'shark.cpp')
-rw-r--r--shark.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/shark.cpp b/shark.cpp
index 0408d8e..56277ce 100644
--- a/shark.cpp
+++ b/shark.cpp
@@ -32,12 +32,11 @@ static word64 SHARKTransform(word64 a)
return result;
}
-void SHARK::Base::UncheckedSetKey(CipherDir dir, const byte *key, unsigned int keyLen, unsigned int rounds)
+void SHARK::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs &params)
{
AssertValidKeyLength(keyLen);
- AssertValidRounds(rounds);
- m_rounds = rounds;
+ m_rounds = GetRoundsAndThrowIfInvalid(params, this);
m_roundKeys.New(m_rounds+1);
// concatenate key enought times to fill a
@@ -55,7 +54,7 @@ void SHARK::Base::UncheckedSetKey(CipherDir dir, const byte *key, unsigned int k
m_roundKeys[m_rounds] = SHARKTransform(m_roundKeys[m_rounds]);
- if (dir == DECRYPTION)
+ if (!IsForwardTransformation())
{
unsigned int i;