~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to rc6.cpp

  • Committer: weidai
  • Date: 2007-08-13 23:48:17 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:383
fixed Salsa20 initialization crash on non-SSE2 machines

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
NAMESPACE_BEGIN(CryptoPP)
9
9
 
10
 
void RC6::Base::UncheckedSetKey(CipherDir direction, const byte *k, unsigned int keylen, unsigned int rounds)
 
10
void RC6::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs &params)
11
11
{
12
12
        AssertValidKeyLength(keylen);
13
 
        AssertValidRounds(rounds);
14
13
 
15
 
        r = rounds;
 
14
        r = GetRoundsAndThrowIfInvalid(params, this);
16
15
        sTable.New(2*(r+2));
17
16
 
18
17
        static const RC6_WORD MAGIC_P = 0xb7e15163L;    // magic constant P for wordsize