Lines Matching full:crc

6 /* crc32.c -- compute the CRC-32 of a data stream
18 #include <u-boot/crc.h>
39 Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
47 byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
58 The table is simply the CRC of all possible eight bit values. This is all
59 the information needed to generate CRC's on data a byte at a time for all
60 combinations of CRC register values and incoming bytes.
67 /* terms of polynomial defining this crc (except x^32): */ in make_crc_table()
87 * Table of CRC-32's of all single-byte values (made by make_crc_table)
173 # define DO_CRC(x) crc = tab[(crc ^ (x)) & 255] ^ (crc >> 8)
175 # define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
181 * don't use ones compliment in their CRC calculations.
183 uint32_t __efi_runtime crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len) in crc32_no_comp() argument
192 crc = cpu_to_le32(crc); in crc32_no_comp()
206 crc ^= *++b; /* use pre increment for speed */ in crc32_no_comp()
221 return le32_to_cpu(crc); in crc32_no_comp()
225 uint32_t __efi_runtime crc32(uint32_t crc, const Bytef *p, uInt len) in crc32() argument
227 return crc32_no_comp(crc ^ 0xffffffffL, p, len) ^ 0xffffffffL; in crc32()
234 uint32_t crc32_wd(uint32_t crc, const unsigned char *buf, uInt len, in crc32_wd() argument
247 crc = crc32 (crc, curr, chunk); in crc32_wd()
252 crc = crc32 (crc, buf, len); in crc32_wd()
255 return crc; in crc32_wd()
261 uint32_t crc; in crc32_wd_buf() local
263 crc = crc32_wd(0, input, ilen, chunk_sz); in crc32_wd_buf()
264 crc = htonl(crc); in crc32_wd_buf()
265 memcpy(output, &crc, sizeof(crc)); in crc32_wd_buf()