92 const uint16_t poly = 0x1021u;
93 crc ^= (uint16_t)((uint16_t) value << 8u);
95 for (i = 0; i < 8; i++) {
96 if (crc & (1u << 15u)) {
97 crc = (uint16_t)((crc << 1u) ^ poly);
100 crc = (uint16_t)(crc << 1u);
128 for (i = 0u; i < length; i++) {
156 const uint64_t poly = 0x42F0E1EBA9EA3693ull;
158 for (j = 0; j < 4; j++) {
159 byte = ((uint8_t *) &value)[j];
160 crc ^= (uint64_t) byte << 56u;
162 for (i = 0; i < 8; i++) {
163 if (crc & (1ull << 63u)) {
164 crc = (uint64_t)(crc << 1u) ^ poly;
167 crc = (uint64_t)(crc << 1u);
__EXPORT uint64_t crc64_add_word(uint64_t crc, uint32_t value)
uint16_t crc16_signature(uint16_t initial, size_t length, const uint8_t *bytes)
uint16_t crc16_add(uint16_t crc, uint8_t value)