~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to rc5.cpp

  • Committer: weidai
  • Date: 2010-06-18 01:52:34 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:485
avoid SecBlock of arrays

Show diffs side-by-side

added added

removed removed

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