Lines Matching full:crc

6 /* crc32.c -- compute the CRC-32 of a data stream
17 #include <u-boot/crc.h>
36 Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
44 byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
55 The table is simply the CRC of all possible eight bit values. This is all
56 the information needed to generate CRC's on data a byte at a time for all
57 combinations of CRC register values and incoming bytes.
64 /* terms of polynomial defining this crc (except x^32): */ in make_crc_table()
83 * Table of CRC-32's of all single-byte values (made by make_crc_table)
169 # define DO_CRC(x) crc = tab[(crc ^ (x)) & 255] ^ (crc >> 8)
171 # define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
177 * don't use ones compliment in their CRC calculations.
179 uint32_t ZEXPORT crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len) in crc32_no_comp() argument
188 crc = cpu_to_le32(crc); in crc32_no_comp()
202 crc ^= *++b; /* use pre increment for speed */ in crc32_no_comp()
217 return le32_to_cpu(crc); in crc32_no_comp()
221 uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *p, uInt len) in crc32() argument
223 return crc32_no_comp(crc ^ 0xffffffffL, p, len) ^ 0xffffffffL; in crc32()
230 uint32_t ZEXPORT crc32_wd (uint32_t crc, in crc32_wd() argument
244 crc = crc32 (crc, curr, chunk); in crc32_wd()
249 crc = crc32 (crc, buf, len); in crc32_wd()
252 return crc; in crc32_wd()
258 uint32_t crc; in crc32_wd_buf() local
260 crc = crc32_wd(0, input, ilen, chunk_sz); in crc32_wd_buf()
261 crc = htonl(crc); in crc32_wd_buf()
262 memcpy(output, &crc, sizeof(crc)); in crc32_wd_buf()