~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to lubyrack.h

  • Committer: noloader
  • Date: 2015-06-29 13:37:03 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:558
Cleared warning on operator precedence

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
NAMESPACE_BEGIN(CryptoPP)
12
12
 
13
 
template <class T> struct DigestSizeDoubleWorkaround {enum {RESULT = 2*T::DIGESTSIZE};};        // VC60 workaround
 
13
template <class T> struct DigestSizeDoubleWorkaround    // VC60 workaround
 
14
{
 
15
        CRYPTOPP_CONSTANT(RESULT = 2*T::DIGESTSIZE)
 
16
};
14
17
 
15
18
//! algorithm info
16
19
template <class T>
17
 
struct LR_Info : public VariableKeyLength<16, 0, 2*(UINT_MAX/2), 2>, public FixedBlockSize<DigestSizeDoubleWorkaround<T>::RESULT>
 
20
struct LR_Info : public VariableKeyLength<16, 0, 2*(INT_MAX/2), 2>, public FixedBlockSize<DigestSizeDoubleWorkaround<T>::RESULT>
18
21
{
19
22
        static std::string StaticAlgorithmName() {return std::string("LR/")+T::StaticAlgorithmName();}
20
23
};
27
30
        {
28
31
        public:
29
32
                // VC60 workaround: have to define these functions within class definition
30
 
                void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length)
 
33
                void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params)
31
34
                {
32
35
                        this->AssertValidKeyLength(length);
33
36
 
38
41
                }
39
42
 
40
43
        protected:
41
 
                enum {S=T::DIGESTSIZE};
 
44
                CRYPTOPP_CONSTANT(S=T::DIGESTSIZE)
42
45
                unsigned int L; // key length / 2
43
46
                SecByteBlock key;
44
47