Home
last modified time | relevance | path

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

12345678910>>...59

/Linux-v6.1/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;
139 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for other
146 static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, argument
[all …]
Dgen_crc32table.c33 * crc is the crc of the byte i; other entries are filled in based on the
41 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()
[all …]
Dcrc64.c3 * Normal 64-bit CRC calculation.
9 * Dr. Ross N. Williams has a great document to introduce the idea of CRC
13 * http://www.ross.net/crc/download/crc_v3.txt
15 * crc64table[256] is the lookup table of a table-driven 64-bit CRC
46 * @crc: seed value for computation. 0 or (u64)~0 for a new CRC calculation,
51 u64 __pure crc64_be(u64 crc, const void *p, size_t len) in crc64_be() argument
58 t = ((crc >> 56) ^ (*_p++)) & 0xFF; in crc64_be()
59 crc = crc64table[t] ^ (crc << 8); in crc64_be()
62 return crc; in crc64_be()
68 * @crc: seed value for computation. 0 for a new CRC calculation, or the
[all …]
Dgen_crc64table.c27 uint64_t i, j, c, crc; in generate_reflected_crc64_table() local
30 crc = 0ULL; in generate_reflected_crc64_table()
34 if ((crc ^ (c >> j)) & 1) in generate_reflected_crc64_table()
35 crc = (crc >> 1) ^ poly; in generate_reflected_crc64_table()
37 crc >>= 1; in generate_reflected_crc64_table()
39 table[i] = crc; in generate_reflected_crc64_table()
45 uint64_t i, j, c, crc; in generate_crc64_table() local
48 crc = 0; in generate_crc64_table()
52 if ((crc ^ c) & 0x8000000000000000ULL) in generate_crc64_table()
53 crc = (crc << 1) ^ poly; in generate_crc64_table()
[all …]
Dcrc-ccitt.c3 * linux/lib/crc-ccitt.c
8 #include <linux/crc-ccitt.h>
11 * This mysterious table is just the CRC of each possible byte. It can be
14 * Add the implicit x^16, and you have the standard CRC-CCITT.
53 * Similar table to calculate CRC16 variant known as CRC-CCITT-FALSE
93 * crc_ccitt - recompute the CRC (CRC-CCITT variant) for the data
95 * @crc: previous CRC value
99 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()
[all …]
/Linux-v6.1/drivers/gpu/drm/
Ddrm_debugfs_crc.c43 * DOC: CRC ABI
45 * DRM device drivers can provide to userspace CRC information of each frame as
46 * it reached a given hardware component (a CRC sampling "source").
49 * file dri/0/crtc-N/crc/control in debugfs, with N being the :ref:`index of
54 * Once frame CRC generation is enabled, userspace can capture them by reading
55 * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
57 * containing the CRC data. Fields are separated by a single space and the number
58 * of CRC fields is source-specific.
60 * Note that though in some cases the CRC is computed in a specified way and on
61 * the frame contents as supplied by userspace (eDP 1.3), in general the CRC
[all …]
/Linux-v6.1/drivers/gpu/drm/nouveau/dispnv50/
Dcrc.c19 #include "crc.h"
77 core->func->crc->set_ctx(head, ctx); in nv50_crc_program_ctx()
84 struct nv50_crc *crc = container_of(work, struct nv50_crc, flip_work); in nv50_crc_ctx_flip_work() local
85 struct nv50_head *head = container_of(crc, struct nv50_head, crc); in nv50_crc_ctx_flip_work()
91 u8 new_idx = crc->ctx_idx ^ 1; in nv50_crc_ctx_flip_work()
98 drm_dbg_kms(dev, "Lock contended, delaying CRC ctx flip for %s\n", crtc->name); in nv50_crc_ctx_flip_work()
104 crtc->name, crc->ctx_idx, new_idx); in nv50_crc_ctx_flip_work()
107 nv50_crc_program_ctx(head, &crc->ctx[new_idx]); in nv50_crc_ctx_flip_work()
113 "Failed to flip CRC context on %s on time (%llu > %llu)\n", in nv50_crc_ctx_flip_work()
116 spin_lock_irq(&crc->lock); in nv50_crc_ctx_flip_work()
[all …]
/Linux-v6.1/drivers/crypto/stm32/
Dstm32-crc32.c104 struct stm32_crc *crc; in stm32_crc_get_next_crc() local
107 crc = list_first_entry(&crc_list.dev_list, struct stm32_crc, list); in stm32_crc_get_next_crc()
108 if (crc) in stm32_crc_get_next_crc()
109 list_move_tail(&crc->list, &crc_list.dev_list); in stm32_crc_get_next_crc()
112 return crc; in stm32_crc_get_next_crc()
119 struct stm32_crc *crc; in stm32_crc_init() local
122 crc = stm32_crc_get_next_crc(); in stm32_crc_init()
123 if (!crc) in stm32_crc_init()
126 pm_runtime_get_sync(crc->dev); in stm32_crc_init()
128 spin_lock_irqsave(&crc->lock, flags); in stm32_crc_init()
[all …]
/Linux-v6.1/arch/mips/crypto/
Dcrc32-mips.c46 #define __CRC32(crc, value, op, SZ, TYPE) \ argument
54 : "+r" (crc) \
58 #define _CRC32_crc32b(crc, value) __CRC32(crc, value, crc32b, 0, 0) argument
59 #define _CRC32_crc32h(crc, value) __CRC32(crc, value, crc32h, 1, 0) argument
60 #define _CRC32_crc32w(crc, value) __CRC32(crc, value, crc32w, 2, 0) argument
61 #define _CRC32_crc32d(crc, value) __CRC32(crc, value, crc32d, 3, 0) argument
62 #define _CRC32_crc32cb(crc, value) __CRC32(crc, value, crc32cb, 0, 1) argument
63 #define _CRC32_crc32ch(crc, value) __CRC32(crc, value, crc32ch, 1, 1) argument
64 #define _CRC32_crc32cw(crc, value) __CRC32(crc, value, crc32cw, 2, 1) argument
65 #define _CRC32_crc32cd(crc, value) __CRC32(crc, value, crc32cd, 3, 1) argument
[all …]
/Linux-v6.1/fs/xfs/libxfs/
Dxfs_cksum.h8 * Calculate the intermediate checksum for a buffer that has the CRC field
9 * inside it. The offset of the 32bit crc fields is passed as the
11 * hence we have to split the CRC calculation across the cksum_offset.
17 uint32_t crc; in xfs_start_cksum_safe() local
19 /* Calculate CRC up to the checksum. */ in xfs_start_cksum_safe()
20 crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset); in xfs_start_cksum_safe()
23 crc = crc32c(crc, &zero, sizeof(__u32)); in xfs_start_cksum_safe()
25 /* Calculate the rest of the CRC. */ in xfs_start_cksum_safe()
26 return crc32c(crc, &buffer[cksum_offset + sizeof(__be32)], in xfs_start_cksum_safe()
31 * Fast CRC method where the buffer is modified. Callers must have exclusive
[all …]
/Linux-v6.1/arch/powerpc/crypto/
Dcrct10dif-vpmsum_glue.c3 * Calculate a CRC T10-DIF with vpmsum acceleration
9 #include <linux/crc-t10dif.h>
25 u32 __crct10dif_vpmsum(u32 crc, unsigned char const *p, size_t len);
31 u32 crc = crci; in crct10dif_vpmsum() local
34 return crc_t10dif_generic(crc, p, len); in crct10dif_vpmsum()
38 crc = crc_t10dif_generic(crc, p, prealign); in crct10dif_vpmsum()
44 crc <<= 16; in crct10dif_vpmsum()
48 crc = __crct10dif_vpmsum(crc, p, len & ~VMX_ALIGN_MASK); in crct10dif_vpmsum()
52 crc >>= 16; in crct10dif_vpmsum()
58 crc = crc_t10dif_generic(crc, p, tail); in crct10dif_vpmsum()
[all …]
/Linux-v6.1/arch/arm/crypto/
Dcrc32-ce-glue.c3 * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions
66 u32 *crc = shash_desc_ctx(desc); in crc32_init() local
68 *crc = *mctx; in crc32_init()
75 u32 *crc = shash_desc_ctx(desc); in crc32_update() local
77 *crc = crc32_armv8_le(*crc, data, length); in crc32_update()
84 u32 *crc = shash_desc_ctx(desc); in crc32c_update() local
86 *crc = crc32c_armv8_le(*crc, data, length); in crc32c_update()
92 u32 *crc = shash_desc_ctx(desc); in crc32_final() local
94 put_unaligned_le32(*crc, out); in crc32_final()
100 u32 *crc = shash_desc_ctx(desc); in crc32c_final() local
[all …]
Dcrct10dif-ce-glue.c3 * Accelerated CRC-T10DIF using ARM NEON and Crypto Extensions instructions
8 #include <linux/crc-t10dif.h>
26 u16 *crc = shash_desc_ctx(desc); in crct10dif_init() local
28 *crc = 0; in crct10dif_init()
35 u16 *crc = shash_desc_ctx(desc); in crct10dif_update() local
39 *crc = crc_t10dif_pmull(*crc, data, length); in crct10dif_update()
42 *crc = crc_t10dif_generic(*crc, data, length); in crct10dif_update()
50 u16 *crc = shash_desc_ctx(desc); in crct10dif_final() local
52 *(u16 *)out = *crc; in crct10dif_final()
/Linux-v6.1/tools/power/acpi/tools/acpidbg/
Dacpidbg.c123 static int acpi_aml_read(int fd, struct circ_buf *crc) in acpi_aml_read() argument
128 p = &crc->buf[crc->head]; in acpi_aml_read()
129 len = circ_space_to_end(crc); in acpi_aml_read()
134 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read()
138 static int acpi_aml_read_batch_cmd(int unused, struct circ_buf *crc) in acpi_aml_read_batch_cmd() argument
144 p = &crc->buf[crc->head]; in acpi_aml_read_batch_cmd()
145 len = circ_space_to_end(crc); in acpi_aml_read_batch_cmd()
155 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read_batch_cmd()
159 static int acpi_aml_read_batch_log(int fd, struct circ_buf *crc) in acpi_aml_read_batch_log() argument
165 p = &crc->buf[crc->head]; in acpi_aml_read_batch_log()
[all …]
/Linux-v6.1/arch/s390/crypto/
Dcrc32-vx.c3 * Crypto-API module for CRC-32 algorithms implemented with the
31 u32 crc; member
35 u32 crc32_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
36 u32 crc32_be_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
37 u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
40 * DEFINE_CRC32_VX() - Define a CRC-32 function using the vector extension
42 * Creates a function to perform a particular CRC-32 computation. Depending
49 static u32 __pure ___fname(u32 crc, \
56 return ___crc32_sw(crc, data, datalen); \
62 crc = ___crc32_sw(crc, data, prealign); \
[all …]
Dcrc32be-vx.S3 * Hardware-accelerated CRC-32 variants for Linux on z Systems
6 * computing of CRC-32 checksums.
8 * This CRC-32 implementation algorithm processes the most-significant
19 /* Vector register range containing CRC-32 constants */
31 * The CRC-32 constant block contains reduction constants to fold and
34 * For the CRC-32 variants, the constants are precomputed according to
55 * CRC-32 (IEEE 802.3 Ethernet, ...) polynomials:
75 * The CRC-32 function(s) use these calling conventions:
79 * %r2: Initial CRC value, typically ~0; and final CRC (return) value.
86 * %r5: CRC-32 constant pool base pointer.
[all …]
Dcrc32le-vx.S3 * Hardware-accelerated CRC-32 variants for Linux on z Systems
6 * computing of bitreflected CRC-32 checksums for IEEE 802.3 Ethernet
9 * This CRC-32 implementation algorithm is bitreflected and processes
20 /* Vector register range containing CRC-32 constants */
32 * The CRC-32 constant block contains reduction constants to fold and
35 * For the CRC-32 variants, the constants are precomputed according to
51 * CRC-32 (IEEE 802.3 Ethernet, ...) polynomials:
56 * CRC-32C (Castagnoli) polynomials:
85 * The CRC-32 functions use these calling conventions:
89 * %r2: Initial CRC value, typically ~0; and final CRC (return) value.
[all …]
/Linux-v6.1/Documentation/staging/
Dcrc32.rst2 brief tutorial on CRC computation
5 A CRC is a long-division remainder. You add the CRC to the message,
6 and the whole thing (message+CRC) is a multiple of the given
7 CRC polynomial. To check the CRC, you can either check that the
8 CRC matches the recomputed value, *or* you can check that the
9 remainder computed on the message+CRC is 0. This latter approach
11 protocols put the end-of-frame flag after the CRC.
21 To produce a 32-bit CRC, the divisor is actually a 33-bit CRC polynomial.
23 CRC is written in hex with the most significant bit omitted. (If you're
26 Note that a CRC is computed over a string of *bits*, so you have
[all …]
/Linux-v6.1/crypto/
Dcrc64_rocksoft_generic.c10 u64 *crc = shash_desc_ctx(desc); in chksum_init() local
12 *crc = 0; in chksum_init()
20 u64 *crc = shash_desc_ctx(desc); in chksum_update() local
22 *crc = crc64_rocksoft_generic(*crc, data, length); in chksum_update()
29 u64 *crc = shash_desc_ctx(desc); in chksum_final() local
31 put_unaligned_le64(*crc, out); in chksum_final()
35 static int __chksum_finup(u64 crc, const u8 *data, unsigned int len, u8 *out) in __chksum_finup() argument
37 crc = crc64_rocksoft_generic(crc, data, len); in __chksum_finup()
38 put_unaligned_le64(crc, out); in __chksum_finup()
45 u64 *crc = shash_desc_ctx(desc); in chksum_finup() local
[all …]
/Linux-v6.1/arch/arm64/crypto/
Dcrct10dif-ce-glue.c3 * Accelerated CRC-T10DIF using arm64 NEON and Crypto Extensions instructions
9 #include <linux/crc-t10dif.h>
28 u16 *crc = shash_desc_ctx(desc); in crct10dif_init() local
30 *crc = 0; in crct10dif_init()
37 u16 *crc = shash_desc_ctx(desc); in crct10dif_update_pmull_p8() local
47 *crc = crc_t10dif_pmull_p8(*crc, data, chunk); in crct10dif_update_pmull_p8()
53 *crc = crc_t10dif_generic(*crc, data, length); in crct10dif_update_pmull_p8()
62 u16 *crc = shash_desc_ctx(desc); in crct10dif_update_pmull_p64() local
72 *crc = crc_t10dif_pmull_p64(*crc, data, chunk); in crct10dif_update_pmull_p64()
78 *crc = crc_t10dif_generic(*crc, data, length); in crct10dif_update_pmull_p64()
[all …]
/Linux-v6.1/Documentation/w1/slaves/
Dw1_ds2423.rst27 memory page along the crc=YES or NO for indicating whether the read operation
28 was successful and CRC matched.
37 - 2 bytes for crc16 which was calculated from the data read since the previous crc bytes
39 - crc=YES/NO indicating whether read was ok and crc matched
44 … ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
45 … ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
46 …0 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408798761
47 … ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5
49 example from the read with crc errors::
51 … ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2
[all …]
/Linux-v6.1/drivers/ipack/
Dipack.c265 static u16 ipack_crc_byte(u16 crc, u8 c) in ipack_crc_byte() argument
269 crc ^= c << 8; in ipack_crc_byte()
271 crc = (crc << 1) ^ ((crc & 0x8000) ? 0x1021 : 0); in ipack_crc_byte()
272 return crc; in ipack_crc_byte()
276 * The algorithm in lib/crc-ccitt.c does not seem to apply since it uses the
282 u16 crc; in ipack_calc_crc1() local
285 crc = 0xffff; in ipack_calc_crc1()
288 crc = ipack_crc_byte(crc, c); in ipack_calc_crc1()
290 crc = ~crc; in ipack_calc_crc1()
291 return crc & 0xff; in ipack_calc_crc1()
[all …]
/Linux-v6.1/include/linux/
Dcrc8.h25 * Return value of crc8() indicating valid message+crc. This is true
26 * if a CRC is inverted before transmission. The CRC computed over the
40 * crc8_populate_lsb - fill crc table for given polynomial in regular bit order.
46 * regular bit order (lsb first). Polynomials in CRC algorithms are typically
58 * crc8_populate_msb - fill crc table for given polynomial in reverse bit order.
64 * reverse bit order (msb first). Polynomials in CRC algorithms are typically
78 * @table: crc table used for calculation.
81 * @crc: previous returned crc8 value.
88 * discontiguous blocks of data. When generating the CRC the
95 * "A Painless Guide to CRC Error Detection Algorithms", ver 3, Aug 1993
[all …]
Dcrc-ccitt.h10 extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len);
11 extern u16 crc_ccitt_false(u16 crc, const u8 *buffer, size_t len);
13 static inline u16 crc_ccitt_byte(u16 crc, const u8 c) in crc_ccitt_byte() argument
15 return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; in crc_ccitt_byte()
18 static inline u16 crc_ccitt_false_byte(u16 crc, const u8 c) in crc_ccitt_false_byte() argument
20 return (crc << 8) ^ crc_ccitt_false_table[(crc >> 8) ^ c]; in crc_ccitt_false_byte()
/Linux-v6.1/arch/x86/crypto/
Dcrct10dif-pclmul_glue.c27 #include <linux/crc-t10dif.h>
40 __u16 crc; member
47 ctx->crc = 0; in chksum_init()
59 ctx->crc = crc_t10dif_pcl(ctx->crc, data, length); in chksum_update()
62 ctx->crc = crc_t10dif_generic(ctx->crc, data, length); in chksum_update()
70 *(__u16 *)out = ctx->crc; in chksum_final()
74 static int __chksum_finup(__u16 crc, const u8 *data, unsigned int len, u8 *out) in __chksum_finup() argument
78 *(__u16 *)out = crc_t10dif_pcl(crc, data, len); in __chksum_finup()
81 *(__u16 *)out = crc_t10dif_generic(crc, data, len); in __chksum_finup()
90 return __chksum_finup(ctx->crc, data, len, out); in chksum_finup()
[all …]

12345678910>>...59