Lines Matching refs:crc
75 static uint32_t crc32c_le_body(uint32_t crc, uint8_t const *buf, size_t len) in crc32c_le_body() argument
86 crc = (__force uint32_t) __cpu_to_le32(crc); in crc32c_le_body()
99 i0 = *p8++ ^ crc; in crc32c_le_body()
100 crc = t0_le[i0] ^ (crc >> 8); in crc32c_le_body()
102 i0 = *p8++ ^ (crc >> 24); in crc32c_le_body()
103 crc = t0_le[i0] ^ (crc << 8); in crc32c_le_body()
112 q = *++p32 ^ crc; in crc32c_le_body()
117 crc = t3_le[i3] ^ t2_le[i2] ^ t1_le[i1] ^ t0_le[i0]; in crc32c_le_body()
119 q = *++p32 ^ crc; in crc32c_le_body()
124 crc = t3_le[i3] ^ t2_le[i2] ^ t1_le[i1] ^ t0_le[i0]; in crc32c_le_body()
132 i0 = *p8++ ^ crc; in crc32c_le_body()
133 crc = t0_le[i0] ^ (crc >> 8); in crc32c_le_body()
135 i0 = *p8++ ^ (crc >> 24); in crc32c_le_body()
136 crc = t0_le[i0] ^ (crc << 8); in crc32c_le_body()
140 return __le32_to_cpu((__force __le32)crc); in crc32c_le_body()
145 static uint32_t crc32c_be_body(uint32_t crc, uint8_t const *buf, size_t len) in crc32c_be_body() argument
156 crc = (__force uint32_t) __cpu_to_be32(crc); in crc32c_be_body()
166 i0 = *p8++ ^ crc; in crc32c_be_body()
167 crc = t0_be[i0] ^ (crc >> 8); in crc32c_be_body()
169 i0 = *p8++ ^ (crc >> 24); in crc32c_be_body()
170 crc = t0_be[i0] ^ (crc << 8); in crc32c_be_body()
178 q = *++p32 ^ crc; in crc32c_be_body()
183 crc = t3_be[i3] ^ t2_be[i2] ^ t1_be[i1] ^ t0_be[i0]; in crc32c_be_body()
185 q = *++p32 ^ crc; in crc32c_be_body()
190 crc = t3_be[i3] ^ t2_be[i2] ^ t1_be[i1] ^ t0_be[i0]; in crc32c_be_body()
198 i0 = *p8++ ^ crc; in crc32c_be_body()
199 crc = t0_be[i0] ^ (crc >> 8); in crc32c_be_body()
201 i0 = *p8++ ^ (crc >> 24); in crc32c_be_body()
202 crc = t0_be[i0] ^ (crc << 8); in crc32c_be_body()
206 return __be32_to_cpu((__force __be32)crc); in crc32c_be_body()
212 static uint32_t crc32c_le_body(uint32_t crc, uint8_t const *buf, size_t len) in crc32c_le_body() argument
223 crc = (__force uint32_t) __cpu_to_le32(crc); in crc32c_le_body()
233 i0 = *p8++ ^ crc; in crc32c_le_body()
234 crc = t0_le[i0] ^ (crc >> 8); in crc32c_le_body()
236 i0 = *p8++ ^ (crc >> 24); in crc32c_le_body()
237 crc = t0_le[i0] ^ (crc << 8); in crc32c_le_body()
245 q = *++p32 ^ crc; in crc32c_le_body()
250 crc = t7_le[i3] ^ t6_le[i2] ^ t5_le[i1] ^ t4_le[i0]; in crc32c_le_body()
257 crc ^= t3_le[i3] ^ t2_le[i2] ^ t1_le[i1] ^ t0_le[i0]; in crc32c_le_body()
259 q = *++p32 ^ crc; in crc32c_le_body()
264 crc = t7_le[i3] ^ t6_le[i2] ^ t5_le[i1] ^ t4_le[i0]; in crc32c_le_body()
271 crc ^= t3_le[i3] ^ t2_le[i2] ^ t1_le[i1] ^ t0_le[i0]; in crc32c_le_body()
279 i0 = *p8++ ^ crc; in crc32c_le_body()
280 crc = t0_le[i0] ^ (crc >> 8); in crc32c_le_body()
282 i0 = *p8++ ^ (crc >> 24); in crc32c_le_body()
283 crc = t0_le[i0] ^ (crc << 8); in crc32c_le_body()
287 return __le32_to_cpu(crc); in crc32c_le_body()
292 static uint32_t crc32c_be_body(uint32_t crc, uint8_t const *buf, size_t len) in crc32c_be_body() argument
303 crc = (__force uint32_t) __cpu_to_be32(crc); in crc32c_be_body()
313 i0 = *p8++ ^ crc; in crc32c_be_body()
314 crc = t0_be[i0] ^ (crc >> 8); in crc32c_be_body()
316 i0 = *p8++ ^ (crc >> 24); in crc32c_be_body()
317 crc = t0_be[i0] ^ (crc << 8); in crc32c_be_body()
325 q = *++p32 ^ crc; in crc32c_be_body()
330 crc = t7_be[i3] ^ t6_be[i2] ^ t5_be[i1] ^ t4_be[i0]; in crc32c_be_body()
337 crc ^= t3_be[i3] ^ t2_be[i2] ^ t1_be[i1] ^ t0_be[i0]; in crc32c_be_body()
339 q = *++p32 ^ crc; in crc32c_be_body()
344 crc = t7_be[i3] ^ t6_be[i2] ^ t5_be[i1] ^ t4_be[i0]; in crc32c_be_body()
351 crc ^= t3_be[i3] ^ t2_be[i2] ^ t1_be[i1] ^ t0_be[i0]; in crc32c_be_body()
359 i0 = *p8++ ^ crc; in crc32c_be_body()
360 crc = t0_be[i0] ^ (crc >> 8); in crc32c_be_body()
362 i0 = *p8++ ^ (crc >> 24); in crc32c_be_body()
363 crc = t0_be[i0] ^ (crc << 8); in crc32c_be_body()
367 return __be32_to_cpu(crc); in crc32c_be_body()
378 uint32_t ext2fs_crc32c_le(uint32_t crc, unsigned char const *p, size_t len) in ext2fs_crc32c_le() argument
383 crc ^= *p++; in ext2fs_crc32c_le()
385 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); in ext2fs_crc32c_le()
389 crc ^= *p++; in ext2fs_crc32c_le()
390 crc = (crc >> 2) ^ t0_le[crc & 0x03]; in ext2fs_crc32c_le()
391 crc = (crc >> 2) ^ t0_le[crc & 0x03]; in ext2fs_crc32c_le()
392 crc = (crc >> 2) ^ t0_le[crc & 0x03]; in ext2fs_crc32c_le()
393 crc = (crc >> 2) ^ t0_le[crc & 0x03]; in ext2fs_crc32c_le()
397 crc ^= *p++; in ext2fs_crc32c_le()
398 crc = (crc >> 4) ^ t0_le[crc & 0x0f]; in ext2fs_crc32c_le()
399 crc = (crc >> 4) ^ t0_le[crc & 0x0f]; in ext2fs_crc32c_le()
403 crc ^= *p++; in ext2fs_crc32c_le()
404 crc = (crc >> 8) ^ t0_le[crc & 0xff]; in ext2fs_crc32c_le()
407 crc = crc32c_le_body(crc, p, len); in ext2fs_crc32c_le()
409 return crc; in ext2fs_crc32c_le()
419 uint32_t ext2fs_crc32c_be(uint32_t crc, unsigned char const *p, size_t len) in ext2fs_crc32c_be() argument
424 crc ^= *p++ << 24; in ext2fs_crc32c_be()
426 crc = (crc << 1) ^ in ext2fs_crc32c_be()
427 ((crc & 0x80000000) ? CRCPOLY_BE : 0); in ext2fs_crc32c_be()
431 crc ^= *p++ << 24; in ext2fs_crc32c_be()
432 crc = (crc << 2) ^ t0_be[crc >> 30]; in ext2fs_crc32c_be()
433 crc = (crc << 2) ^ t0_be[crc >> 30]; in ext2fs_crc32c_be()
434 crc = (crc << 2) ^ t0_be[crc >> 30]; in ext2fs_crc32c_be()
435 crc = (crc << 2) ^ t0_be[crc >> 30]; in ext2fs_crc32c_be()
439 crc ^= *p++ << 24; in ext2fs_crc32c_be()
440 crc = (crc << 4) ^ t0_be[crc >> 28]; in ext2fs_crc32c_be()
441 crc = (crc << 4) ^ t0_be[crc >> 28]; in ext2fs_crc32c_be()
445 crc ^= *p++ << 24; in ext2fs_crc32c_be()
446 crc = (crc << 8) ^ t0_be[crc >> 24]; in ext2fs_crc32c_be()
449 crc = crc32c_be_body(crc, p, len); in ext2fs_crc32c_be()
451 return crc; in ext2fs_crc32c_be()
971 uint32_t crc; /* random starting crc */ member
1115 le = ext2fs_crc32c_le(t->crc, test_buf + t->start, t->length); in test_crc32c()
1116 be = ext2fs_crc32c_be(t->crc, test_buf + t->start, t->length); in test_crc32c()