8
8
class NullHash : public HashTransformation
11
void Update(const byte *input, size_t length) {}
11
void Update(const byte *input, unsigned int length) {}
12
12
unsigned int DigestSize() const {return 0;}
13
void TruncatedFinal(byte *digest, size_t digestSize) {}
14
bool TruncatedVerify(const byte *digest, size_t digestLength) {return true;}
13
void TruncatedFinal(byte *digest, unsigned int digestSize) {}
14
bool TruncatedVerify(const byte *digest, unsigned int digestLength) {return true;}
17
17
//! construct new HashModule with smaller DigestSize() from existing one
22
22
TruncatedHashTemplate(T hm, unsigned int digestSize)
23
23
: m_hm(hm), m_digestSize(digestSize) {}
24
TruncatedHashTemplate(const byte *key, size_t keyLength, unsigned int digestSize)
24
TruncatedHashTemplate(const byte *key, unsigned int keyLength, unsigned int digestSize)
25
25
: m_hm(key, keyLength), m_digestSize(digestSize) {}
26
TruncatedHashTemplate(size_t digestSize)
26
TruncatedHashTemplate(unsigned int digestSize)
27
27
: m_digestSize(digestSize) {}
29
void Update(const byte *input, size_t length)
29
void Update(const byte *input, unsigned int length)
30
30
{m_hm.Update(input, length);}
31
31
unsigned int DigestSize() const {return m_digestSize;}
32
void TruncatedFinal(byte *digest, size_t digestSize)
32
void TruncatedFinal(byte *digest, unsigned int digestSize)
33
33
{m_hm.TruncatedFinal(digest, digestSize);}
34
bool TruncatedVerify(const byte *digest, size_t digestLength)
34
bool TruncatedVerify(const byte *digest, unsigned int digestLength)
35
35
{return m_hm.TruncatedVerify(digest, digestLength);}