Lines Matching refs:crc
62 u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
70 u32 crc32_le(u32 crc, unsigned char const *p, size_t len) in crc32_le() argument
74 crc ^= *p++; in crc32_le()
76 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); in crc32_le()
78 return crc; in crc32_le()
82 u32 crc32_le(u32 crc, unsigned char const *p, size_t len) in crc32_le() argument
89 # define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) in crc32_le()
91 # define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) in crc32_le()
94 crc = __cpu_to_le32(crc); in crc32_le()
109 crc ^= *++b; in crc32_le()
127 return __le32_to_cpu(crc); in crc32_le()
133 crc ^= *p++; in crc32_le()
134 crc = (crc >> 4) ^ crc32table_le[crc & 15]; in crc32_le()
135 crc = (crc >> 4) ^ crc32table_le[crc & 15]; in crc32_le()
137 return crc; in crc32_le()
140 crc ^= *p++; in crc32_le()
141 crc = (crc >> 2) ^ crc32table_le[crc & 3]; in crc32_le()
142 crc = (crc >> 2) ^ crc32table_le[crc & 3]; in crc32_le()
143 crc = (crc >> 2) ^ crc32table_le[crc & 3]; in crc32_le()
144 crc = (crc >> 2) ^ crc32table_le[crc & 3]; in crc32_le()
146 return crc; in crc32_le()
158 u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len);
166 u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) in crc32_be() argument
170 crc ^= *p++ << 24; in crc32_be()
172 crc = in crc32_be()
173 (crc << 1) ^ ((crc & 0x80000000) ? CRCPOLY_BE : in crc32_be()
176 return crc; in crc32_be()
180 u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) in crc32_be() argument
187 # define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) in crc32_be()
189 # define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) in crc32_be()
192 crc = __cpu_to_be32(crc); in crc32_be()
207 crc ^= *++b; in crc32_be()
224 return __be32_to_cpu(crc); in crc32_be()
230 crc ^= *p++ << 24; in crc32_be()
231 crc = (crc << 4) ^ crc32table_be[crc >> 28]; in crc32_be()
232 crc = (crc << 4) ^ crc32table_be[crc >> 28]; in crc32_be()
234 return crc; in crc32_be()
237 crc ^= *p++ << 24; in crc32_be()
238 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
239 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
240 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
241 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
243 return crc; in crc32_be()