~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to blowfish.cpp

  • Committer: weidai
  • Date: 2007-05-04 15:36:15 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:339
fix compile

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
NAMESPACE_BEGIN(CryptoPP)
8
8
 
9
 
void Blowfish::Base::UncheckedSetKey(CipherDir dir, const byte *key_string, unsigned int keylength)
 
9
void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs &)
10
10
{
11
11
        AssertValidKeyLength(keylength);
12
12
 
35
35
        for (i=0; i<4*256-2; i+=2)
36
36
                crypt_block(sbox+i, sbox+i+2);
37
37
 
38
 
        if (dir==DECRYPTION)
 
38
        if (!IsForwardTransformation())
39
39
                for (i=0; i<(ROUNDS+2)/2; i++)
40
40
                        std::swap(pbox[i], pbox[ROUNDS+1-i]);
41
41
}