/freebsd-src/contrib/libarchive/libarchive/ |
H A D | archive_crc32.h | 44 crc32(unsigned long crc, const void *_p, size_t len) in crc32() 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 in crc32() 42 crc32(unsigned long crc,const void * _p,size_t len) crc32() argument [all...] |
/freebsd-src/contrib/xz/src/liblzma/check/ |
H A D | crc64_fast.c | 37 crc64_generic(const uint8_t *buf, size_t size, uint64_t crc) in crc64_generic() argument 39 crc = ~crc; in crc64_generic() 42 crc = byteswap64(crc); in crc64_generic() 47 crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); in crc64_generic() 56 const uint32_t tmp = (uint32_t)(crc >> 32) in crc64_generic() 59 const uint32_t tmp = (uint32_t)crc in crc64_generic() 64 crc = lzma_crc64_table[3][A(tmp)] in crc64_generic() 66 ^ S32(crc) in crc64_generic() 73 crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); in crc64_generic() 76 crc = byteswap64(crc); in crc64_generic() [all …]
|
H A D | crc32_fast.c | 32 crc32_generic(const uint8_t *buf, size_t size, uint32_t crc) in crc32_generic() argument 34 crc = ~crc; in crc32_generic() 37 crc = byteswap32(crc); in crc32_generic() 44 crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc); in crc32_generic() 57 crc ^= aligned_read32ne(buf); in crc32_generic() 60 crc = lzma_crc32_table[7][A(crc)] in crc32_generic() 61 ^ lzma_crc32_table[6][B(crc)] in crc32_generic() 62 ^ lzma_crc32_table[5][C(crc)] in crc32_generic() 63 ^ lzma_crc32_table[4][D(crc)]; in crc32_generic() 69 // performance, that the crc variable is XORed in crc32_generic() [all …]
|
H A D | crc32_arm64.h | 17 // MSVC always has the CRC intrinsics available when building for ARM64 40 # define crc_attr_target __attribute__((__target__("+crc"))) 48 crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc) in crc32_arch_optimized() argument 50 crc = ~crc; in crc32_arch_optimized() 57 crc = __crc32b(crc, *buf); in crc32_arch_optimized() 67 crc = __crc32d(crc, aligned_read64le(buf)); in crc32_arch_optimized() 71 crc = __crc32b(crc, *buf); in crc32_arch_optimized() 73 return ~crc; in crc32_arch_optimized()
|
H A D | crc64_small.c | 43 lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) in lzma_crc64() argument 49 crc = ~crc; in lzma_crc64() 52 crc = crc64_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); in lzma_crc64() 56 return ~crc; in lzma_crc64()
|
H A D | crc32_small.c | 53 lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) in lzma_crc32() argument 59 crc = ~crc; in lzma_crc32() 62 crc = lzma_crc32_table[0][*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); in lzma_crc32() 66 return ~crc; in lzma_crc32()
|
/freebsd-src/sys/contrib/zlib/ |
H A D | crc32.c | 1 /* 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-src/sys/libkern/x86/ |
H A D | crc32_sse42.c | 69 /* 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-src/contrib/llvm-project/llvm/lib/Target/Mips/ |
H A D | MipsCondMov.td | 18 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-src/sys/fs/ext2fs/ |
H A D | ext2_csum.c | 125 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-src/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | CRC.h | 1 //===-- 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-src/contrib/llvm-project/clang/lib/Headers/ |
H A D | crc32intrin.h | 16 /// 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-src/contrib/llvm-project/llvm/lib/Support/ |
H A D | CRC.cpp | 1 //===--- 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-src/sys/sys/ |
H A D | gsb_crc32.h | 16 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()
|
/freebsd-src/contrib/xz/src/liblzma/api/lzma/ |
H A D | check.h | 118 * \param crc Previously returned CRC value. This is used to 119 * calculate the CRC of a big buffer in smaller chunks. 122 * \return Updated CRC value, which can be passed to this function 123 * again to continue CRC calculation. 126 const uint8_t *buf, size_t size, uint32_t crc) 139 * \param crc Previously returned CRC value. This is used to 140 * calculate the CRC of a big buffer in smaller chunks. 143 * \return Updated CRC value, which can be passed to this function 144 * again to continue CRC calculation. 147 const uint8_t *buf, size_t size, uint64_t crc)
|
/freebsd-src/sys/contrib/xz-embedded/linux/lib/xz/ |
H A D | xz_crc32.c | 14 * 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 D | xz_crc64.c | 44 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-src/tools/diag/dumpvfscache/ |
H A D | dumpvfscache.c | 37 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-src/usr.bin/cksum/ |
H A D | crc32.c | 6 * 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-src/sys/dev/sbni/ |
H A D | if_sbni.c | 443 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-src/contrib/llvm-project/compiler-rt/lib/scudo/standalone/ |
H A D | chunk.h | 29 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 >> 16)); in computeChecksum() 101 // We do not need a cryptographically strong hash for the checksum, but a CRC
|
/freebsd-src/sys/contrib/ncsw/Peripherals/FM/MAC/ |
H A D | fman_crc32.c | 38 /* 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-src/sys/contrib/ncsw/Peripherals/FM/Pcd/ |
H A D | crc64.h | 38 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-src/sys/libkern/ |
H A D | gsb_crc32.c | 20 * 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 ^ ~0U; 132 /* CRC LOOKUP TABLE */ 134 /* The following CRC lookup table was generated automagically */ [all …]
|
/freebsd-src/crypto/heimdal/lib/krb5/ |
H A D | crc.c | 44 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()
|