~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to crc.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:
19
19
class CRC32 : public HashTransformation
20
20
{
21
21
public:
22
 
        enum {DIGESTSIZE = 4};
 
22
        CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
23
23
        CRC32();
24
24
        void Update(const byte *input, size_t length);
25
25
        void TruncatedFinal(byte *hash, size_t size);
26
26
        unsigned int DigestSize() const {return DIGESTSIZE;}
 
27
    static const char * StaticAlgorithmName() {return "CRC32";}
 
28
    std::string AlgorithmName() const {return StaticAlgorithmName();}
27
29
 
28
30
        void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
29
31
        byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];}