Lines Matching full:crc
69 /* CRC-32C (iSCSI) polynomial in reversed bit order. */
73 * Block sizes for three-way parallel crc computation. LONG and SHORT must
80 * Tables for updating a crc for LONG, 2 * LONG, SHORT and 2 * SHORT bytes
124 * Construct an operator to apply len zeros to a crc. len must be a power of
138 odd[0] = POLY; /* CRC-32C polynomial */ in crc32c_zeros_op()
189 /* Apply the zeros operator table to crc. */
191 crc32c_shift(uint32_t zeros[][256], uint32_t crc) in crc32c_shift() argument
194 return (zeros[0][crc & 0xff] ^ zeros[1][(crc >> 8) & 0xff] ^ in crc32c_shift()
195 zeros[2][(crc >> 16) & 0xff] ^ zeros[3][crc >> 24]); in crc32c_shift()
214 /* Compute CRC-32C using the Intel hardware instruction. */
216 sse42_crc32c(uint32_t crc, const unsigned char *buf, unsigned len) in sse42_crc32c() argument
231 crc0 = crc; in sse42_crc32c()
233 /* Compute the crc to bring the data pointer to an aligned boundary. */ in sse42_crc32c()
242 * Compute the crc on sets of LONG*3 bytes, executing three independent in sse42_crc32c()
243 * crc instructions, each on LONG bytes -- this is optimized for the in sse42_crc32c()
245 * have a throughput of one crc per cycle, but a latency of three in sse42_crc32c()
248 crc = 0; in sse42_crc32c()
270 * Update the crc. Try to do it in parallel with the inner in sse42_crc32c()
271 * loop. 'crc' is used to accumulate crc0 and crc1 in sse42_crc32c()
276 * crc = S*S*S*crc + S*S*crc0 + S*crc1 in sse42_crc32c()
277 * where the terms are polynomials modulo the CRC polynomial. in sse42_crc32c()
279 * crc = S*S * (S*crc + crc0) + S*crc1. in sse42_crc32c()
287 * it in crc. This synchronizes the loop with crc update. in sse42_crc32c()
292 * parallelizable take about 24 cycles and the crc update in sse42_crc32c()
299 * 12 cycles and the crc update about 24, but these are in sse42_crc32c()
305 * the crc update, the inner loop must take considerably in sse42_crc32c()
312 crc = crc32c_shift(crc32c_long, crc) ^ crc0; in sse42_crc32c()
314 crc = crc32c_shift(crc32c_2long, crc) ^ crc1; in sse42_crc32c()
319 crc0 ^= crc; in sse42_crc32c()
326 crc = 0; in sse42_crc32c()
347 crc = crc32c_shift(crc32c_short, crc) ^ crc0; in sse42_crc32c()
349 crc = crc32c_shift(crc32c_2short, crc) ^ crc1; in sse42_crc32c()
354 crc0 ^= crc; in sse42_crc32c()
356 /* Compute the crc on the remaining bytes at native word size. */ in sse42_crc32c()
368 /* Compute the crc for any trailing bytes. */ in sse42_crc32c()