1 #ifndef CRYPTOPP_CRC32_H
2 #define CRYPTOPP_CRC32_H
6 NAMESPACE_BEGIN(CryptoPP)
8 const word32 CRC32_NEGL = 0xffffffffL;
10 #ifdef IS_LITTLE_ENDIAN
11 #define CRC32_INDEX(c) (c & 0xff)
12 #define CRC32_SHIFTED(c) (c >> 8)
14 #define CRC32_INDEX(c) (c >> 24)
15 #define CRC32_SHIFTED(c) (c << 8)
22 CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
24 void Update(
const byte *input,
size_t length);
27 static const char * StaticAlgorithmName() {
return "CRC32";}
30 void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
31 byte GetCrcByte(
size_t i)
const {
return ((byte *)&(m_crc))[i];}
34 void Reset() {m_crc = CRC32_NEGL;}
36 static const word32 m_tab[256];
unsigned int DigestSize() const
size of the hash/digest/MAC returned by Final()
void TruncatedFinal(byte *hash, size_t size)
truncated version of Final()
std::string AlgorithmName() const
returns name of this algorithm, not universally implemented yet
void Update(const byte *input, size_t length)
process more input
CRC Checksum Calculation.