Home
last modified time | relevance | path

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

12345678910

/freebsd/contrib/libarchive/libarchive/
H A Darchive_crc32.h44 crc32(unsigned long crc, const void *_p, size_t len) in crc32() argument
68 crc = crc ^ 0xffffffffUL; in crc32()
72 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
73 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
74 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
75 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
76 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
77 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
78 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
79 crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
[all …]
/freebsd/sys/libkern/
H A Dgsb_crc32.c119 * uint32_t crc;
121 * crc = ~0U;
123 * crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
124 * return crc ^ ~0U;
221 singletable_crc32c(uint32_t crc, const void *buf, size_t size)
226 crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> in singletable_crc32c()
224 singletable_crc32c(uint32_t crc,const void * buf,size_t size) singletable_crc32c() argument
681 crc32c_sb8_64_bit(uint32_t crc,const unsigned char * p_buf,uint32_t length,uint32_t init_bytes) crc32c_sb8_64_bit() argument
[all...]
/freebsd/sys/contrib/zlib/
H A Dcrc32.c575 unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, in crc32_z() argument
592 crc = (~crc) & 0xffffffff; in crc32_z()
598 __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val)); in crc32_z()
616 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); in crc32_z()
622 crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc1; in crc32_z()
623 crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc2; in crc32_z()
637 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); in crc32_z()
644 crc = multmodp(val, crc) ^ crc1; in crc32_z()
645 crc = multmodp(val, crc) ^ crc2; in crc32_z()
651 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0)); in crc32_z()
[all …]
/freebsd/sys/fs/ext2fs/
H A Dext2_csum.c125 uint32_t crc, dummy_crc = 0; in ext2_extattr_blk_csum() local
131 crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&facl_bn, in ext2_extattr_blk_csum()
133 crc = calculate_crc32c(crc, (uint8_t *)header, offset); in ext2_extattr_blk_csum()
134 crc = calculate_crc32c(crc, (uint8_t *)&dummy_crc, in ext2_extattr_blk_csum()
137 crc = calculate_crc32c(crc, (uint8_t *)header + offset, in ext2_extattr_blk_csum()
140 return (htole32(crc)); in ext2_extattr_blk_csum()
232 uint32_t inum, gen, crc; in ext2_dirent_csum() local
240 crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); in ext2_dirent_csum()
241 crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); in ext2_dirent_csum()
242 crc = calculate_crc32c(crc, (uint8_t *)buf, size); in ext2_dirent_csum()
[all …]
/freebsd/sys/contrib/ncsw/Peripherals/FM/MAC/
H A Dfman_crc32.c107 uint32_t crc; in get_mac_addr_crc() local
110 crc = 0xffffffff; in get_mac_addr_crc()
113 crc = crc ^ data; in get_mac_addr_crc()
114 crc = crc_tbl[crc&0xff] ^ (crc>>8); in get_mac_addr_crc()
117 crc = get_mirror32(crc); in get_mac_addr_crc()
118 return crc; in get_mac_addr_crc()
/freebsd/sys/libkern/x86/
H A Dcrc32_sse42.c191 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()
216 sse42_crc32c(uint32_t crc, const unsigned char *buf, unsigned len) in sse42_crc32c() argument
231 crc0 = crc; in sse42_crc32c()
248 crc = 0; 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()
[all …]
/freebsd/sys/sys/
H A Dgsb_crc32.h16 crc32_raw(const void *buf, size_t size, uint32_t crc) in crc32_raw() argument
21 crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); in crc32_raw()
22 return (crc); in crc32_raw()
28 uint32_t crc; in crc32() local
30 crc = crc32_raw(buf, size, ~0U); in crc32()
31 return (crc ^ ~0U); in crc32()
H A Dcrc16.h37 crc16(uint16_t crc, const void *buffer, unsigned int len) in crc16() argument
41 crc = (((crc >> 8) & 0xffU) ^ in crc16()
42 crc16_table[(crc ^ *cp++) & 0xffU]) & 0x0000ffffU; in crc16()
43 return crc; in crc16()
/freebsd/tools/diag/dumpvfscache/
H A Ddumpvfscache.c37 u_short crc = 0; in wlpsacrc() local
42 r1 = crc16_table[crc & 0xF]; in wlpsacrc()
43 crc = (crc >> 4) & 0x0FFF; in wlpsacrc()
44 crc = crc ^ r1 ^ crc16_table[*buf & 0xF]; in wlpsacrc()
47 r1 = crc16_table[crc & 0xF]; in wlpsacrc()
48 crc = (crc >> 4) & 0x0FFF; in wlpsacrc()
49 crc = crc ^ r1 ^ crc16_table[(*buf >> 4) & 0xF]; in wlpsacrc()
51 return(crc); in wlpsacrc()
/freebsd/sys/dev/sbni/
H A Dif_sbni.c443 u_int32_t crc; in recv_frame() local
447 crc = CRC32_INITIAL; in recv_frame()
448 if (check_fhdr(sc, &framelen, &frameno, &ack, &is_first, &crc)) { in recv_frame()
450 upload_data(sc, framelen, frameno, is_first, crc) : in recv_frame()
451 skip_tail(sc, framelen, crc); in recv_frame()
477 u_int32_t crc; in send_frame() local
480 crc = CRC32_INITIAL; in send_frame()
495 send_frame_header(sc, &crc); in send_frame()
503 download_data(sc, &crc); in send_frame()
508 sbni_outsb(sc, (u_char *)&crc, sizeof crc); in send_frame()
[all …]
/freebsd/sys/net80211/
H A Dieee80211_crypto_wep.c353 uint32_t i, j, k, crc; in wep_encrypt() local
379 crc = ~0; in wep_encrypt()
388 crc = crc32_table[(crc ^ *pos) & 0xff] ^ (crc >> 8); in wep_encrypt()
410 crc = ~crc; in wep_encrypt()
413 icv[0] = crc; in wep_encrypt()
414 icv[1] = crc >> 8; in wep_encrypt()
415 icv[2] = crc >> 16; in wep_encrypt()
416 icv[3] = crc >> 24; in wep_encrypt()
436 uint32_t i, j, k, crc; in wep_decrypt() local
462 crc = ~0; in wep_decrypt()
[all …]
H A Dieee80211_crypto_tkip.c669 u32 i, j, k, crc; in wep_encrypt() local
686 crc = ~0; in wep_encrypt()
696 crc = crc32_table[(crc ^ *pos) & 0xff] ^ (crc >> 8); in wep_encrypt()
711 crc = ~crc; in wep_encrypt()
714 icv[0] = crc; in wep_encrypt()
715 icv[1] = crc >> 8; in wep_encrypt()
716 icv[2] = crc >> 16; in wep_encrypt()
717 icv[3] = crc >> 24; in wep_encrypt()
729 u32 i, j, k, crc; in wep_decrypt() local
744 crc = ~0; in wep_decrypt()
[all …]
/freebsd/crypto/heimdal/lib/krb5/
H A Dcrc.c44 unsigned long crc, poly; in _krb5_crc_init_table() local
50 crc = i; in _krb5_crc_init_table()
52 if (crc & 1) { in _krb5_crc_init_table()
53 crc = (crc >> 1) ^ poly; in _krb5_crc_init_table()
55 crc >>= 1; in _krb5_crc_init_table()
58 table[i] = crc; in _krb5_crc_init_table()
/freebsd/sys/contrib/xz-embedded/linux/lib/xz/
H A 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()
H A Dxz_crc64.c44 XZ_EXTERN uint64_t xz_crc64(const uint8_t *buf, size_t size, uint64_t crc) in xz_crc64() argument
46 crc = ~crc; in xz_crc64()
49 crc = xz_crc64_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); in xz_crc64()
53 return ~crc; in xz_crc64()
/freebsd/sys/contrib/ncsw/inc/Peripherals/
H A Dcrc_mac_addr_ext.h310 #define GET_MAC_ADDR_CRC(addr, crc) \ argument
316 crc = 0xffffffff; \
320 crc = crc^data; \
321 crc = crc_table[crc&0xff] ^ (crc>>8); \
/freebsd/sys/fs/udf/
H A Dosta.c214 unsigned short crc=0; in udf_cksum() local
217 crc = crc_table[(crc>>8 ^ *s++) & 0xff] ^ (crc<<8); in udf_cksum()
218 return crc; in udf_cksum()
225 unsigned short crc=0; in udf_unicode_cksum() local
231 crc = crc_table[(crc>>8 ^ (*s>>8)) & 0xff] ^ (crc<<8); in udf_unicode_cksum()
232 crc = crc_table[(crc>>8 ^ (*s++ & 0xff)) & 0xff] ^ (crc<<8); in udf_unicode_cksum()
234 return crc; in udf_unicode_cksum()
/freebsd/contrib/wpa/src/utils/
H A Dcrc32.c78 u32 crc; in ieee80211_crc32() local
80 crc = 0xFFFFFFFF; in ieee80211_crc32()
82 crc = crc32_table[(crc ^ frame[i]) & 0xff] ^ (crc >> 8); in ieee80211_crc32()
84 return ~crc; in ieee80211_crc32()
/freebsd/sys/dev/sfxge/common/
H A Defx_crc32.c115 uint32_t crc = crc_init; in efx_crc32_calculate() local
119 crc = (crc >> 8) ^ efx_crc32_table[(crc ^ data) & 0xff]; in efx_crc32_calculate()
122 return (crc); in efx_crc32_calculate()
/freebsd/sbin/hastd/
H A Dhast_checksum.c48 uint32_t crc; in hast_crc32_checksum() local
50 crc = crc32(0L, Z_NULL, 0); in hast_crc32_checksum()
51 crc = crc32(crc, data, size); in hast_crc32_checksum()
54 bcopy(&crc, hash, sizeof(crc)); in hast_crc32_checksum()
55 *hsizep = sizeof(crc); in hast_crc32_checksum()
/freebsd/usr.bin/mkimg/
H A Dgpt.c120 uint32_t crc = ~0U; in crc32() local
123 crc = crc32_tab[(crc ^ *p++) & 0xff] ^ (crc >> 8); in crc32()
124 return (crc ^ ~0U); in crc32()
218 uint32_t crc; in gpt_write_hdr() local
224 crc = crc32(hdr, offsetof(struct gpt_hdr, padding)); in gpt_write_hdr()
225 le64enc(&hdr->hdr_crc_self, crc); in gpt_write_hdr()
235 uint32_t crc; in gpt_write() local
272 crc = crc32(tbl, tblsz * secsz); in gpt_write()
273 le32enc(&hdr->hdr_crc_table, crc); in gpt_write()
/freebsd/sys/contrib/ncsw/Peripherals/FM/Pcd/
H A Dcrc64.h348 uint64_t crc = seed; in crc64_compute() local
352 crc = in crc64_compute()
354 table[(crc ^ *bdata++) & CRC64_BYTE_MASK] ^ (crc >> 8); in crc64_compute()
356 return crc; in crc64_compute()
/freebsd/usr.bin/cksum/
H A Dcrc32.c22 #define CRC(crc, ch) (crc = (crc >> 8) ^ crctab[(crc ^ (ch)) & 0xff]) argument
/freebsd/contrib/tcpdump/
H A Dprint-802_15_4.c427 uint16_t crc; in ieee802_15_4_crc16() local
430 crc = 0x0000; /* Note, initial value is 0x0000 not 0xffff. */ in ieee802_15_4_crc16()
440 x = crc >> 8 ^ y; in ieee802_15_4_crc16()
442 crc = ((uint16_t)(crc << 8)) ^ in ieee802_15_4_crc16()
449 crc = (((crc & 0xaaaa) >> 1) | ((crc & 0x5555) << 1)); in ieee802_15_4_crc16()
450 crc = (((crc & 0xcccc) >> 2) | ((crc & 0x3333) << 2)); in ieee802_15_4_crc16()
451 crc = (((crc & 0xf0f0) >> 4) | ((crc & 0x0f0f) << 4)); in ieee802_15_4_crc16()
452 crc = (((crc & 0xff00) >> 8) | ((crc & 0x00ff) << 8)); in ieee802_15_4_crc16()
453 return crc; in ieee802_15_4_crc16()
479 uint32_t crc, byte; in ieee802_15_4_crc32() local
[all …]
/freebsd/sys/dev/firewire/
H A Dfwcrom.c227 uint32_t data, sum, crc = 0; in crom_crc() local
232 sum = ((crc >> 12) ^ (data >> shift)) & 0xf; in crom_crc()
233 crc = (crc << 4) ^ (sum << 12) ^ (sum << 5) ^ sum; in crom_crc()
235 crc &= 0xffff; in crom_crc()
237 return ((uint16_t) crc); in crom_crc()
300 uint16_t crc; in crom_desc() local
321 crc = crom_crc((uint32_t *)&dir->entry[0], dir->crc_len); in crom_desc()
323 dir->crc_len, dir->crc, in crom_desc()
324 (crc == dir->crc) ? "OK" : "NG"); in crom_desc()
515 chunk->data.crc = in crom_load()
[all …]

12345678910