Home
last modified time | relevance | path

Searched refs:crc (Results 1 – 19 of 19) sorted by relevance

/lib/
Dcrc32.c58 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) argument
61 # define DO_CRC(x) crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8)
67 # define DO_CRC(x) crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
106 q = crc ^ *++b; /* use pre increment for speed */
108 crc = DO_CRC4;
110 crc = DO_CRC8;
112 crc ^= DO_CRC4;
128 return crc;
146 static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, argument
153 crc ^= *p++;
[all …]
Dgen_crc32table.c41 uint32_t crc = 1; in crc32init_le_generic() local
46 crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0); in crc32init_le_generic()
48 tab[0][i + j] = crc ^ tab[0][j]; in crc32init_le_generic()
51 crc = tab[0][i]; in crc32init_le_generic()
53 crc = tab[0][crc & 0xff] ^ (crc >> 8); in crc32init_le_generic()
54 tab[j][i] = crc; in crc32init_le_generic()
75 uint32_t crc = 0x80000000; in crc32init_be() local
80 crc = (crc << 1) ^ ((crc & 0x80000000) ? CRC32_POLY_BE : 0); in crc32init_be()
82 crc32table_be[0][i + j] = crc ^ crc32table_be[0][j]; in crc32init_be()
85 crc = crc32table_be[0][i]; in crc32init_be()
[all …]
Dcrc-ccitt.c99 u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) in crc_ccitt() argument
102 crc = crc_ccitt_byte(crc, *buffer++); in crc_ccitt()
103 return crc; in crc_ccitt()
114 u16 crc_ccitt_false(u16 crc, u8 const *buffer, size_t len) in crc_ccitt_false() argument
117 crc = crc_ccitt_false_byte(crc, *buffer++); in crc_ccitt_false()
118 return crc; in crc_ccitt_false()
Dgen_crc64table.c25 uint64_t i, j, c, crc; in generate_crc64_table() local
28 crc = 0; in generate_crc64_table()
32 if ((crc ^ c) & 0x8000000000000000ULL) in generate_crc64_table()
33 crc = (crc << 1) ^ CRC64_ECMA182_POLY; in generate_crc64_table()
35 crc <<= 1; in generate_crc64_table()
39 crc64_table[i] = crc; in generate_crc64_table()
Dcrc32test.c552 u32 crc; /* random starting crc */ member
674 static u32 crc; in crc32c_test() local
680 crc ^= __crc32c_le(test[i].crc, test_buf + in crc32c_test()
690 if (test[i].crc32c_le != __crc32c_le(test[i].crc, test_buf + in crc32c_test()
719 crc_full = __crc32c_le(test[i].crc, test_buf + test[i].start, in crc32c_combine_test()
725 crc1 = __crc32c_le(test[i].crc, test_buf + in crc32c_combine_test()
756 static u32 crc; in crc32_test() local
762 crc ^= crc32_le(test[i].crc, test_buf + in crc32_test()
765 crc ^= crc32_be(test[i].crc, test_buf + in crc32_test()
775 if (test[i].crc_le != crc32_le(test[i].crc, test_buf + in crc32_test()
[all …]
Dcrc64.c43 u64 __pure crc64_be(u64 crc, const void *p, size_t len) in crc64_be() argument
50 t = ((crc >> 56) ^ (*_p++)) & 0xFF; in crc64_be()
51 crc = crc64table[t] ^ (crc << 8); in crc64_be()
54 return crc; in crc64_be()
Dcrc16.c55 u16 crc16(u16 crc, u8 const *buffer, size_t len) in crc16() argument
58 crc = crc16_byte(crc, *buffer++); in crc16()
59 return crc; in crc16()
Dcrc7.c65 u8 crc7_be(u8 crc, const u8 *buffer, size_t len) in crc7_be() argument
68 crc = crc7_be_byte(crc, *buffer++); in crc7_be()
69 return crc; in crc7_be()
Dcrc-itu-t.c57 u16 crc_itu_t(u16 crc, const u8 *buffer, size_t len) in crc_itu_t() argument
60 crc = crc_itu_t_byte(crc, *buffer++); in crc_itu_t()
61 return crc; in crc_itu_t()
Dcrc8.c74 u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc) in crc8() argument
78 crc = table[(crc ^ *pdata++) & 0xff]; in crc8()
80 return crc; in crc8()
Dcrc-t10dif.c57 __u16 crc_t10dif_update(__u16 crc, const unsigned char *buffer, size_t len) in crc_t10dif_update() argument
66 return crc_t10dif_generic(crc, buffer, len); in crc_t10dif_update()
70 *(__u16 *)desc.ctx = crc; in crc_t10dif_update()
Dlibcrc32c.c38 u32 crc32c(u32 crc, const void *address, unsigned int length) in crc32c() argument
45 *ctx = crc; in crc32c()
DMakefile124 obj-$(CONFIG_CRC_CCITT) += crc-ccitt.o
126 obj-$(CONFIG_CRC_T10DIF)+= crc-t10dif.o
127 obj-$(CONFIG_CRC_ITU_T) += crc-itu-t.o
Dinflate.c1138 static ulg crc; /* initialized in makecrc() so it'll reside in bss */ variable
1139 #define CRC_VALUE (crc ^ 0xffffffffUL)
1179 crc = (ulg)0xffffffffUL; /* shift register contents */ in makecrc()
/lib/xz/
Dxz_crc32.c49 XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc) in xz_crc32() argument
51 crc = ~crc; in xz_crc32()
54 crc = xz_crc32_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); in xz_crc32()
58 return ~crc; in xz_crc32()
Dxz_dec_test.c62 static uint32_t crc; variable
73 crc = 0xFFFFFFFF; in xz_dec_test_open()
134 crc = crc32(crc, buffer_out, buffers.out_pos); in xz_dec_test_write()
144 "CRC32 = 0x%08X\n", ~crc); in xz_dec_test_write()
Dxz_stream.h16 # define xz_crc32(buf, size, crc) \ argument
17 (~crc32_le(~(uint32_t)(crc), buf, size))
/lib/842/
D842_decompress.c283 u64 crc; in sw842_decompress() local
378 ret = next_bits(&p, &crc, CRC_BITS); in sw842_decompress()
385 if (crc != (u64)crc32_be(0, out, total - p.olen)) { in sw842_decompress()
D842_compress.c484 u32 crc; in sw842_compress() local
582 crc = crc32_be(0, in, ilen); in sw842_compress()
583 ret = add_bits(p, crc, CRC_BITS); in sw842_compress()