32-bit CRC implementation.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | COMPLEMENT_CRC(c) ((c) ^ 0xffffffffUL) |
Convenience macro for inverting the CRC. More... | |
#define | CRC32_POLYNOMIAL 0xEDB88320UL |
Polynomial for 32-bit CRC in IEEE 802.3. More... | |
#define | WORD_ALIGNMENT_MASK ~((uintptr_t)WORD_SIZE - 1) |
Bitmask for word-aligning an address. More... | |
#define | WORD_SIZE (sizeof(word_t)) |
Convenience macro for size of a word. More... | |
Typedefs | |
typedef unsigned int | word_t |
Convenience typedef for words. More... | |
Functions | |
static crc32_t | _crc32_recalculate_bytes_helper (word_t data, crc32_t crc, uint_fast8_t bytes) |
Recalculate 32-bit CRC for bytes within a word. More... | |
enum status_code | crc32_recalculate (const void *data, size_t length, crc32_t *crc) |
Recalculate 32-bit CRC for another block. More... | |
Convenience macro for inverting the CRC.
Referenced by crc32_recalculate().
#define CRC32_POLYNOMIAL 0xEDB88320UL |
Polynomial for 32-bit CRC in IEEE 802.3.
Referenced by _crc32_recalculate_bytes_helper().
#define WORD_ALIGNMENT_MASK ~((uintptr_t)WORD_SIZE - 1) |
Bitmask for word-aligning an address.
Referenced by crc32_recalculate().
#define WORD_SIZE (sizeof(word_t)) |
Convenience macro for size of a word.
Referenced by crc32_recalculate().
typedef unsigned int word_t |
Convenience typedef for words.
|
inlinestatic |
Recalculate 32-bit CRC for bytes within a word.
[in] | data | Data to recalculate for. |
[in] | crc | Initial/current CRC value. |
[in] | bytes | Number of data bytes in word. |
References CRC32_POLYNOMIAL, and data.
Referenced by crc32_recalculate().