Home
last modified time | relevance | path

Searched full:crc (Results 1 – 25 of 713) sorted by relevance

12345678910>>...29

/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/contrib/zlib/
H A Dcrc32.c1 /* crc32.c -- compute the CRC-32 of a data stream
5 * This interleaved implementation of a CRC makes use of pipelined multiple
7 * Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution.
15 of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
33 A CRC of a message is computed on N braids of words in the message, where
39 into a single CRC at the end. For this code, N must be in the range 1..6 and
136 * Table of powers of x for combining CRC-32s, filled in by make_crc_table()
142 * Tables for byte-wise and braided CRC-32 calculations, and a table of powers
143 * of x for combining CRC-32s, all made by make_crc_table().
148 /* CRC polynomial. */
[all …]
/freebsd/sys/libkern/x86/
H A Dcrc32_sse42.c69 /* 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. */
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/Mips/
H A DMipsCondMov.td18 class CMov_I_I_FT<string opstr, RegisterOperand CRC, RegisterOperand DRC,
20 InstSE<(outs DRC:$rd), (ins DRC:$rs, CRC:$rt, DRC:$F),
26 class CMov_I_F_FT<string opstr, RegisterOperand CRC, RegisterOperand DRC,
28 InstSE<(outs DRC:$fd), (ins DRC:$fs, CRC:$rt, DRC:$F),
55 multiclass MovzPats0<RegisterClass CRC, RegisterClass DRC,
59 def : MipsPat<(select (i32 (setge CRC:$lhs, CRC:$rhs)), DRC:$T, DRC:$F),
60 (MOVZInst DRC:$T, (SLTOp CRC:$lhs, CRC:$rhs), DRC:$F)>;
61 def : MipsPat<(select (i32 (setuge CRC:$lhs, CRC:$rhs)), DRC:$T, DRC:$F),
62 (MOVZInst DRC:$T, (SLTuOp CRC:$lhs, CRC:$rhs), DRC:$F)>;
63 def : MipsPat<(select (i32 (setge CRC:$lhs, immSExt16:$rhs)), DRC:$T, DRC:$F),
[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/contrib/llvm-project/llvm/include/llvm/Support/
H A DCRC.h1 //===-- llvm/Support/CRC.h - Cyclic Redundancy Check-------------*- C++ -*-===//
9 // This file contains implementations of CRC functions.
21 // Compute the CRC-32 of Data.
24 // Compute the running CRC-32 of Data, with CRC being the previous value of the
26 uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
30 // We will use the "Rocksoft^tm Model CRC Algorithm" to describe the properties
31 // of this CRC:
38 // Check : 340BC6D9 (result of CRC for "123456789")
40 // In other words, this is the same as CRC-32, except that XorOut is 0 instead
47 JamCRC(uint32_t Init = 0xFFFFFFFFU) : CRC(Init) {} in CRC() function
[all …]
/freebsd/contrib/llvm-project/clang/lib/Headers/
H A Dcrc32intrin.h16 /// Adds the unsigned integer operand to the CRC-32C checksum of the
24 /// An unsigned integer operand to add to the CRC-32C checksum of operand
27 /// An unsigned 8-bit integer operand used to compute the CRC-32C checksum.
28 /// \returns The result of adding operand \a __C to the CRC-32C checksum of
36 /// Adds the unsigned integer operand to the CRC-32C checksum of the
44 /// An unsigned integer operand to add to the CRC-32C checksum of operand
47 /// An unsigned 16-bit integer operand used to compute the CRC-32C checksum.
48 /// \returns The result of adding operand \a __C to the CRC-32C checksum of
56 /// Adds the first unsigned integer operand to the CRC-32C checksum of
64 /// An unsigned integer operand to add to the CRC-32C checksum of operand
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Support/
H A DCRC.cpp1 //===--- CRC.cpp - Cyclic Redundancy Check implementation -----------------===//
9 // This file contains implementations of CRC functions.
15 // See also Ross N. Williams "A Painless Guide to CRC Error Detection
21 #include "llvm/Support/CRC.h"
75 uint32_t llvm::crc32(uint32_t CRC, ArrayRef<uint8_t> Data) { in crc32() argument
76 CRC ^= 0xFFFFFFFFU; in crc32()
78 int TableIdx = (CRC ^ Byte) & 0xff; in crc32()
79 CRC = CRCTable[TableIdx] ^ (CRC >> 8); in crc32()
81 return CRC ^ 0xFFFFFFFFU; in crc32()
87 uint32_t llvm::crc32(uint32_t CRC, ArrayRef<uint8_t> Data) { in crc32() argument
[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/sys/contrib/xz-embedded/linux/lib/xz/
H A Dxz_crc32.c14 * accelerated CRC instruction are 3-5 times as fast as this version,
49 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/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/usr.bin/cksum/
H A Dcrc32.c6 * the crc computation is finished. The crc should be complemented
8 * The variable corresponding to the macro argument "crc" should
10 * use. An error-free packet will leave 0xDEBB20E3 in the crc.
22 #define CRC(crc, ch) (crc = (crc >> 8) ^ crctab[(crc ^ (ch)) & 0xff]) macro
109 CRC(lcrc, *p) ; in crc32()
110 CRC(crc32_total, *p) ; in crc32()
/freebsd/sys/contrib/ncsw/Peripherals/FM/Pcd/
H A Dcrc64.h38 functions used for calculating crc.
57 \brief '64 bit crc' Table
61 uint64_t table[CRC64_TABLE_ENTRIES]; /**< CRC table entries */
329 \brief Initializes the crc seed
337 \brief Computes 64 bit the crc
340 \param[in] crc seed
341 \return calculated crc
348 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()
[all …]
/freebsd/sys/contrib/ncsw/Peripherals/FM/MAC/
H A Dfman_crc32.c38 /* precomputed CRC values for address hashing */
107 uint32_t crc; in get_mac_addr_crc() local
109 /* CRC calculation */ in get_mac_addr_crc()
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/
H A Dgsb_crc32.c20 * do it this way? Because the calculated CRC must be transmitted in
22 * characters in order from LSB to MSB. By storing the CRC this way
33 * tions for all combinations of data and CRC register values
110 * A function that calculates the CRC-32 based on the table above is
119 * uint32_t crc;
121 * crc = ~0U;
123 * crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
124 * return crc
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/contrib/llvm-project/compiler-rt/lib/scudo/standalone/
H A Dchunk.h29 u32 Crc = static_cast<u32>(CRC32_INTRINSIC(Seed, Value)); in computeChecksum() local
31 Crc = static_cast<u32>(CRC32_INTRINSIC(Crc, Array[I])); in computeChecksum()
32 return static_cast<u16>(Crc ^ (Crc >> 16)); in computeChecksum()
35 u32 Crc = computeHardwareCRC32(Seed, Value); in computeChecksum()
37 Crc = computeHardwareCRC32(Crc, Array[I]); in computeChecksum()
38 return static_cast<u16>(Crc ^ (Crc >> 1 in computeChecksum()
[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/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 …]
/freebsd/sys/contrib/device-tree/Bindings/crypto/
H A Dst,stm32-crc.yaml4 $id: http://devicetree.org/schemas/crypto/st,stm32-crc.yaml#
7 title: STMicroelectronics STM32 CRC
14 const: st,stm32f7-crc
32 crc@40023000 {
33 compatible = "st,stm32f7-crc";
/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()
53 /* XXXPJD: Do we have to use htole32() on crc first? */ in hast_crc32_checksum()
54 bcopy(&crc, hash, sizeof(crc)); in hast_crc32_checksum()
55 *hsizep = sizeof(crc); in hast_crc32_checksum()
/freebsd/sys/contrib/ncsw/inc/Peripherals/
H A Dcrc_mac_addr_ext.h39 /* Define a macro that calculate the crc value of */
310 #define GET_MAC_ADDR_CRC(addr, crc) \ argument
315 /* CRC calculation */ \
316 crc = 0xffffffff; \
320 crc = crc^data; \
321 crc = crc_table[crc&0xff] ^ (crc>>8); \
327 /* Sometimes the mirrored value of the CRC is required */
/freebsd/sys/geom/raid/
H A Dmd_ddf.h39 uint32_t CRC; member
90 uint32_t CRC; member
164 uint32_t CRC; member
209 uint32_t CRC; member
221 uint32_t CRC; member
278 uint32_t CRC; member
291 uint32_t CRC; member
308 uint32_t CRC; member
329 uint32_t CRC; member
340 uint32_t CRC; member

12345678910>>...29