~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to seckey.h

  • Committer: weidai
  • Date: 2007-04-16 00:43:17 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:321
IV_REQUIREMENT changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
};
111
111
 
112
112
/// support query of key length that's the same as another class
113
 
template <class T>
 
113
template <class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
114
114
class SameKeyLengthAs
115
115
{
116
116
public:
117
117
        CRYPTOPP_CONSTANT(MIN_KEYLENGTH=T::MIN_KEYLENGTH)
118
118
        CRYPTOPP_CONSTANT(MAX_KEYLENGTH=T::MAX_KEYLENGTH)
119
119
        CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH)
120
 
        CRYPTOPP_CONSTANT(IV_REQUIREMENT = T::IV_REQUIREMENT)
121
 
        CRYPTOPP_CONSTANT(IV_LENGTH = T::IV_LENGTH)
 
120
        CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ)
 
121
        CRYPTOPP_CONSTANT(IV_LENGTH=IV_L)
 
122
 
122
123
        static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
123
124
                {return T::StaticGetValidKeyLength(keylength);}
124
125
};
134
135
        size_t MaxKeyLength() const {return (size_t)INFO::MAX_KEYLENGTH;}
135
136
        size_t DefaultKeyLength() const {return INFO::DEFAULT_KEYLENGTH;}
136
137
        size_t GetValidKeyLength(size_t n) const {return INFO::StaticGetValidKeyLength(n);}
137
 
        typename BASE::IV_Requirement IVRequirement() const {return (typename BASE::IV_Requirement)INFO::IV_REQUIREMENT;}
 
138
        SimpleKeyingInterface::IV_Requirement IVRequirement() const {return (SimpleKeyingInterface::IV_Requirement)INFO::IV_REQUIREMENT;}
138
139
        unsigned int IVSize() const {return INFO::IV_LENGTH;}
139
140
};
140
141