7 #ifndef CRYPTOPP_CRC32_H 8 #define CRYPTOPP_CRC32_H 14 const word32 CRC32_NEGL = 0xffffffffL;
16 #ifdef IS_LITTLE_ENDIAN 17 #define CRC32_INDEX(c) (c & 0xff) 18 #define CRC32_SHIFTED(c) (c >> 8) 20 #define CRC32_INDEX(c) (c >> 24) 21 #define CRC32_SHIFTED(c) (c << 8) 28 CRYPTOPP_CONSTANT(DIGESTSIZE = 4)
30 void Update(
const byte *input,
size_t length);
33 static const char * StaticAlgorithmName() {
return "CRC32";}
36 void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
37 byte GetCrcByte(
size_t i)
const {
return ((byte *)&(m_crc))[i];}
40 void Reset() {m_crc = CRC32_NEGL;}
42 static const word32 m_tab[256];
Abstract base classes that provide a uniform interface to this library.
unsigned int DigestSize() const
Provides the digest size of the hash.
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
std::string AlgorithmName() const
Provides the name of this algorithm.
void Update(const byte *input, size_t length)
Updates a hash with additional input.
Crypto++ library namespace.
CRC Checksum Calculation.