4 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5 * See included license file for license details.
8 #define CRYPTOPP_CRC32_H
12 const uint32_t CRC32_NEGL = 0xffffffffL;
14 #ifdef __LITTLE_ENDIAN__
15 #define CRC32_INDEX(c) (c & 0xff)
16 #define CRC32_SHIFTED(c) (c >> 8)
18 #define CRC32_INDEX(c) (c >> 24)
19 #define CRC32_SHIFTED(c) (c << 8)
22 //! CRC Checksum Calculation
33 void update(const uint8_t * input, unsigned length);
35 void truncatedFinal(uint8_t * hash, unsigned size);
37 void updateByte(uint8_t b) { m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc); }
38 uint8_t getCrcByte(unsigned i) const { return ((uint8_t *)&(m_crc))[i]; }
41 void reset() { m_crc = CRC32_NEGL; m_count = 0; }
43 static const uint32_t m_tab[256];