~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to idea.cpp

  • Committer: weidai
  • Date: 2011-01-07 01:30:24 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:522
fix for compiling with Clang from Marshall Clow

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
}
31
31
 
32
32
#ifdef IDEA_LARGECACHE
33
 
bool IDEA::Base::tablesBuilt = false;
 
33
volatile bool IDEA::Base::tablesBuilt = false;
34
34
word16 IDEA::Base::log[0x10000];
35
35
word16 IDEA::Base::antilog[0x10000];
36
36
 
78
78
}
79
79
#endif // IDEA_LARGECACHE
80
80
 
81
 
void IDEA::Base::UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length)
 
81
void IDEA::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &)
82
82
{
83
83
        AssertValidKeyLength(length);
84
84
        
88
88
        
89
89
        EnKey(userKey);
90
90
        
91
 
        if (direction==DECRYPTION)
 
91
        if (!IsForwardTransformation())
92
92
                DeKey();
93
93
        
94
94
#ifdef IDEA_LARGECACHE
129
129
void IDEA::Base::DeKey()
130
130
{
131
131
        FixedSizeSecBlock<IDEA::Word, 6*ROUNDS+4> tempkey;
132
 
        unsigned int i;
 
132
        size_t i;
133
133
 
134
134
        for (i=0; i<ROUNDS; i++)
135
135
        {