~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to dmac.h

  • Committer: weidai
  • Date: 2006-12-09 17:18:13 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:247
add Salsa20 cipher

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
public:
13
13
        static std::string StaticAlgorithmName() {return std::string("DMAC(") + T::StaticAlgorithmName() + ")";}
14
14
 
15
 
        CRYPTOPP_CONSTANT(DIGESTSIZE=T::BLOCKSIZE)
 
15
        enum {DIGESTSIZE=T::BLOCKSIZE};
16
16
 
17
17
        DMAC_Base() {}
18
18
 
19
 
        void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
 
19
        void CheckedSetKey(void *, Empty empty, const byte *key, size_t length, const NameValuePairs &params);
20
20
        void Update(const byte *input, size_t length);
21
21
        void TruncatedFinal(byte *mac, size_t size);
22
22
        unsigned int DigestSize() const {return DIGESTSIZE;}
45
45
};
46
46
 
47
47
template <class T>
48
 
void DMAC_Base<T>::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
 
48
void DMAC_Base<T>::CheckedSetKey(void *, Empty empty, const byte *key, size_t length, const NameValuePairs &params)
49
49
{
50
50
        m_subkeylength = T::StaticGetValidKeyLength(T::BLOCKSIZE);
51
51
        m_subkeys.resize(2*UnsignedMin((unsigned int)T::BLOCKSIZE, m_subkeylength));