/freebsd/contrib/libarchive/libarchive/ |
H A D | archive_crc32.h | 44 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/contrib/xz/src/liblzma/check/ |
H A D | crc32_fast.c | 41 const uint8_t *buf, size_t size, uint32_t crc); 44 lzma_crc32_generic(const uint8_t *buf, size_t size, uint32_t crc) in lzma_crc32_generic() argument 46 crc = ~crc; in lzma_crc32_generic() 49 crc = byteswap32(crc); in lzma_crc32_generic() 56 crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc); in lzma_crc32_generic() 69 crc ^= aligned_read32ne(buf); in lzma_crc32_generic() 72 crc = lzma_crc32_table[7][A(crc)] in lzma_crc32_generic() 73 ^ lzma_crc32_table[6][B(crc)] in lzma_crc32_generic() 74 ^ lzma_crc32_table[5][C(crc)] in lzma_crc32_generic() 75 ^ lzma_crc32_table[4][D(crc)]; in lzma_crc32_generic() [all …]
|
H A D | crc64_fast.c | 37 const uint8_t *buf, size_t size, uint64_t crc); 49 lzma_crc64_generic(const uint8_t *buf, size_t size, uint64_t crc) in lzma_crc64_generic() argument 51 crc = ~crc; in lzma_crc64_generic() 54 crc = byteswap64(crc); in lzma_crc64_generic() 59 crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); in lzma_crc64_generic() 68 const uint32_t tmp = (uint32_t)(crc >> 32) in lzma_crc64_generic() 71 const uint32_t tmp = (uint32_t)crc in lzma_crc64_generic() 76 crc = lzma_crc64_table[3][A(tmp)] in lzma_crc64_generic() 78 ^ S32(crc) in lzma_crc64_generic() 85 crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); in lzma_crc64_generic() [all …]
|
H A D | crc32_loongarch.h | 22 int32_t crc = (int32_t)~crc_unsigned; in crc32_arch_optimized() local 28 crc = __crc_w_b_w((int8_t)*buf++, crc); in crc32_arch_optimized() 31 crc = __crc_w_h_w((int16_t)aligned_read16le(buf), crc); in crc32_arch_optimized() 36 crc = __crc_w_w_w((int32_t)aligned_read32le(buf), crc); in crc32_arch_optimized() 44 crc = __crc_w_d_w((int64_t)aligned_read64le(buf), crc); in crc32_arch_optimized() 50 crc = __crc_w_w_w((int32_t)aligned_read32le(buf), crc); in crc32_arch_optimized() 55 crc = __crc_w_h_w((int16_t)aligned_read16le(buf), crc); in crc32_arch_optimized() 60 crc = __crc_w_b_w((int8_t)*buf, crc); in crc32_arch_optimized() 62 return (uint32_t)~crc; in crc32_arch_optimized()
|
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() 58 crc = __crc32b(crc, *buf++); in crc32_arch_optimized() 61 crc = __crc32h(crc, aligned_read16le(buf)); in crc32_arch_optimized() 66 crc = __crc32w(crc, aligned_read32le(buf)); in crc32_arch_optimized() 79 crc = __crc32d(crc, aligned_read64le(buf)); in crc32_arch_optimized() 86 crc = __crc32w(crc, aligned_read32le(buf)); in crc32_arch_optimized() 91 crc = __crc32h(crc, aligned_read16le(buf)); in crc32_arch_optimized() [all …]
|
H A D | crc32_small.c | 56 lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) in lzma_crc32() argument 62 crc = ~crc; in lzma_crc32() 65 crc = lzma_crc32_table[0][*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); in lzma_crc32() 69 return ~crc; in lzma_crc32()
|
/freebsd/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/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/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/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/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/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/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/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/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/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/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/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/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 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/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/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/sys/dev/mmc/ |
H A D | mmcspi.c | 54 * CRC routines adapted from public domain code written by Lammert Bies. 65 * CRC checking is enabled by default, but can be disabled at runtime 166 unsigned char use_crc; /* do crc checking for this command */ 194 unsigned int crc_enabled; /* crc checking is enabled */ 195 unsigned int crc_init_done; /* whether the initial crc setting has 205 unsigned int use_crc; /* command CRC checking */ 267 update_crc7(uint8_t crc, uint8_t *buf, unsigned int len) in update_crc7() argument 273 tmp = (crc << 1) ^ buf[i]; in update_crc7() 274 crc = crc7tab[tmp]; in update_crc7() 277 return (crc); in update_crc7() [all …]
|
/freebsd/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 >> 1 in computeChecksum() [all...] |
/freebsd/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()
|