Lines Matching refs:crc

63 __u32 crc32_le(__u32 crc, unsigned char const *p, size_t len);
71 __u32 crc32_le(__u32 crc, unsigned char const *p, size_t len) in crc32_le() argument
75 crc ^= *p++; in crc32_le()
77 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); in crc32_le()
79 return crc; in crc32_le()
83 __u32 crc32_le(__u32 crc, unsigned char const *p, size_t len) in crc32_le() argument
90 # define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) in crc32_le()
92 # define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) in crc32_le()
95 crc = __cpu_to_le32(crc); in crc32_le()
110 crc ^= *++b; in crc32_le()
128 return __le32_to_cpu(crc); in crc32_le()
134 crc ^= *p++; in crc32_le()
135 crc = (crc >> 4) ^ crc32table_le[crc & 15]; in crc32_le()
136 crc = (crc >> 4) ^ crc32table_le[crc & 15]; in crc32_le()
138 return crc; in crc32_le()
141 crc ^= *p++; 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()
145 crc = (crc >> 2) ^ crc32table_le[crc & 3]; in crc32_le()
147 return crc; in crc32_le()
161 __u32 crc32_be(__u32 crc, unsigned char const *p, size_t len);
169 __u32 crc32_be(__u32 crc, unsigned char const *p, size_t len) in crc32_be() argument
173 crc ^= *p++ << 24; in crc32_be()
175 crc = in crc32_be()
176 (crc << 1) ^ ((crc & 0x80000000) ? CRCPOLY_BE : in crc32_be()
179 return crc; in crc32_be()
183 __u32 crc32_be(__u32 crc, unsigned char const *p, size_t len) in crc32_be() argument
190 # define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) in crc32_be()
192 # define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) in crc32_be()
195 crc = __cpu_to_be32(crc); in crc32_be()
210 crc ^= *++b; in crc32_be()
227 return __be32_to_cpu(crc); in crc32_be()
233 crc ^= *p++ << 24; in crc32_be()
234 crc = (crc << 4) ^ crc32table_be[crc >> 28]; in crc32_be()
235 crc = (crc << 4) ^ crc32table_be[crc >> 28]; in crc32_be()
237 return crc; in crc32_be()
240 crc ^= *p++ << 24; in crc32_be()
241 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
242 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
243 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
244 crc = (crc << 2) ^ crc32table_be[crc >> 30]; in crc32_be()
246 return crc; in crc32_be()