Home
last modified time | relevance | path

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

12345678910>>...19

/Linux-v5.4/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;
146 static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, argument
153 crc ^= *p++;
[all …]
Dgen_crc32table.c41 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()
85 crc = crc32table_be[0][i]; in crc32init_be()
[all …]
Dcrc-ccitt.c99 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()
114 u16 crc_ccitt_false(u16 crc, u8 const *buffer, size_t len) in crc_ccitt_false() argument
117 crc = crc_ccitt_false_byte(crc, *buffer++); in crc_ccitt_false()
118 return crc; in crc_ccitt_false()
Dcrc32test.c552 u32 crc; /* random starting crc */ member
674 static u32 crc; in crc32c_test() local
680 crc ^= __crc32c_le(test[i].crc, test_buf + in crc32c_test()
690 if (test[i].crc32c_le != __crc32c_le(test[i].crc, test_buf + in crc32c_test()
719 crc_full = __crc32c_le(test[i].crc, test_buf + test[i].start, in crc32c_combine_test()
725 crc1 = __crc32c_le(test[i].crc, test_buf + in crc32c_combine_test()
756 static u32 crc; in crc32_test() local
762 crc ^= crc32_le(test[i].crc, test_buf + in crc32_test()
765 crc ^= crc32_be(test[i].crc, test_buf + in crc32_test()
775 if (test[i].crc_le != crc32_le(test[i].crc, test_buf + in crc32_test()
[all …]
Dgen_crc64table.c25 uint64_t i, j, c, crc; in generate_crc64_table() local
28 crc = 0; in generate_crc64_table()
32 if ((crc ^ c) & 0x8000000000000000ULL) in generate_crc64_table()
33 crc = (crc << 1) ^ CRC64_ECMA182_POLY; in generate_crc64_table()
35 crc <<= 1; in generate_crc64_table()
39 crc64_table[i] = crc; in generate_crc64_table()
/Linux-v5.4/drivers/gpu/drm/
Ddrm_debugfs_crc.c100 if (strcmp(sources[i], crtc->crc.source)) in crc_control_show()
109 seq_printf(m, "%s*\n", crtc->crc.source); in crc_control_show()
125 struct drm_crtc_crc *crc = &crtc->crc; in crc_control_write() local
150 spin_lock_irq(&crc->lock); in crc_control_write()
152 if (crc->opened) { in crc_control_write()
153 spin_unlock_irq(&crc->lock); in crc_control_write()
158 kfree(crc->source); in crc_control_write()
159 crc->source = source; in crc_control_write()
161 spin_unlock_irq(&crc->lock); in crc_control_write()
176 static int crtc_crc_data_count(struct drm_crtc_crc *crc) in crtc_crc_data_count() argument
[all …]
/Linux-v5.4/drivers/crypto/stm32/
Dstm32-crc32.c62 struct stm32_crc *crc; member
101 struct stm32_crc *crc; in stm32_crc_init() local
104 list_for_each_entry(crc, &crc_list.dev_list, list) { in stm32_crc_init()
105 ctx->crc = crc; in stm32_crc_init()
110 pm_runtime_get_sync(ctx->crc->dev); in stm32_crc_init()
113 writel_relaxed(bitrev32(mctx->key), ctx->crc->regs + CRC_INIT); in stm32_crc_init()
114 writel_relaxed(bitrev32(mctx->poly), ctx->crc->regs + CRC_POL); in stm32_crc_init()
115 writel_relaxed(CRC_CR_RESET | CRC_CR_REVERSE, ctx->crc->regs + CRC_CR); in stm32_crc_init()
118 ctx->partial = readl_relaxed(ctx->crc->regs + CRC_DR); in stm32_crc_init()
119 ctx->crc->nb_pending_bytes = 0; in stm32_crc_init()
[all …]
/Linux-v5.4/drivers/net/ethernet/mellanox/mlx5/core/steering/
Ddr_crc32.c38 u32 crc, i, j; in mlx5dr_crc32_init_table() local
41 crc = i; in mlx5dr_crc32_init_table()
43 if (crc & 0x00000001L) in mlx5dr_crc32_init_table()
44 crc = (crc >> 1) ^ DR_STE_CRC_POLY; in mlx5dr_crc32_init_table()
46 crc = crc >> 1; in mlx5dr_crc32_init_table()
48 dr_ste_crc_tab32[0][i] = crc; in mlx5dr_crc32_init_table()
68 u32 crc = 0, one, two; in mlx5dr_crc32_slice8_calc() local
75 one = *curr++ ^ crc; in mlx5dr_crc32_slice8_calc()
78 crc = dr_ste_crc_tab32[0][(two >> 24) & 0xff] in mlx5dr_crc32_slice8_calc()
93 crc = (crc >> 8) ^ dr_ste_crc_tab32[0][(crc & 0xff) in mlx5dr_crc32_slice8_calc()
[all …]
/Linux-v5.4/arch/powerpc/crypto/
Dcrct10dif-vpmsum_glue.c25 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()
61 return crc & 0xffff; in crct10dif_vpmsum()
66 u16 *crc = shash_desc_ctx(desc); in crct10dif_vpmsum_init() local
[all …]
/Linux-v5.4/drivers/staging/wlan-ng/
Dp80211wep.c147 u32 i, j, k, crc, keylen; in wep_decrypt() local
187 crc = ~0; in wep_decrypt()
195 crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8); in wep_decrypt()
197 crc = ~crc; in wep_decrypt()
200 c_crc[0] = crc; in wep_decrypt()
201 c_crc[1] = crc >> 8; in wep_decrypt()
202 c_crc[2] = crc >> 16; in wep_decrypt()
203 c_crc[3] = crc >> 24; in wep_decrypt()
220 u32 i, j, k, crc, keylen; in wep_encrypt() local
260 crc = ~0; in wep_encrypt()
[all …]
/Linux-v5.4/arch/mips/crypto/
Dcrc32-mips.c53 #define _CRC32(crc, value, size, type) \ argument
60 : "+r" (crc) \
64 #define CRC32(crc, value, size) \ argument
65 _CRC32(crc, value, size, crc32)
67 #define CRC32C(crc, value, size) \ argument
68 _CRC32(crc, value, size, crc32c)
72 u32 crc = crc_; local
78 CRC32(crc, value, d);
89 CRC32(crc, value, w);
97 CRC32(crc, value, h);
[all …]
/Linux-v5.4/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-v5.4/arch/arm/crypto/
Dcrc32-ce-glue.c68 u32 *crc = shash_desc_ctx(desc); in crc32_init() local
70 *crc = *mctx; in crc32_init()
77 u32 *crc = shash_desc_ctx(desc); in crc32_update() local
79 *crc = crc32_armv8_le(*crc, data, length); in crc32_update()
86 u32 *crc = shash_desc_ctx(desc); in crc32c_update() local
88 *crc = crc32c_armv8_le(*crc, data, length); in crc32c_update()
94 u32 *crc = shash_desc_ctx(desc); in crc32_final() local
96 put_unaligned_le32(*crc, out); in crc32_final()
102 u32 *crc = shash_desc_ctx(desc); in crc32c_final() local
104 put_unaligned_le32(~*crc, out); in crc32c_final()
[all …]
Dcrct10dif-ce-glue.c26 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-v5.4/arch/arm64/crypto/
Dcrct10dif-ce-glue.c28 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
41 *crc = crc_t10dif_pmull_p8(*crc, data, length); in crct10dif_update_pmull_p8()
44 *crc = crc_t10dif_generic(*crc, data, length); in crct10dif_update_pmull_p8()
53 u16 *crc = shash_desc_ctx(desc); in crct10dif_update_pmull_p64() local
57 *crc = crc_t10dif_pmull_p64(*crc, data, length); in crct10dif_update_pmull_p64()
60 *crc = crc_t10dif_generic(*crc, data, length); in crct10dif_update_pmull_p64()
68 u16 *crc = shash_desc_ctx(desc); in crct10dif_final() local
70 *(u16 *)out = *crc; in crct10dif_final()
/Linux-v5.4/fs/xfs/libxfs/
Dxfs_cksum.h17 uint32_t crc; in xfs_start_cksum_safe() local
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()
26 return crc32c(crc, &buffer[cksum_offset + sizeof(__be32)], in xfs_start_cksum_safe()
52 xfs_end_cksum(uint32_t crc) in xfs_end_cksum() argument
54 return ~cpu_to_le32(crc); in xfs_end_cksum()
66 uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset); in xfs_update_cksum() local
68 *(__le32 *)(buffer + cksum_offset) = xfs_end_cksum(crc); in xfs_update_cksum()
77 uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset); in xfs_verify_cksum() local
79 return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc); in xfs_verify_cksum()
/Linux-v5.4/arch/s390/crypto/
Dcrc32-vx.c31 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);
49 static u32 __pure ___fname(u32 crc, \
56 return ___crc32_sw(crc, data, datalen); \
62 crc = ___crc32_sw(crc, data, prealign); \
70 crc = ___crc32_vx(crc, data, aligned); \
74 crc = ___crc32_sw(crc, data + aligned, remaining); \
76 return crc; \
[all …]
/Linux-v5.4/fs/ocfs2/
Dblockcheck.c354 u32 crc; in ocfs2_block_check_compute() local
359 crc = crc32_le(~0, data, blocksize); in ocfs2_block_check_compute()
368 bc->bc_crc32e = cpu_to_le32(crc); in ocfs2_block_check_compute()
387 u32 crc, ecc; in ocfs2_block_check_validate() local
397 crc = crc32_le(~0, data, blocksize); in ocfs2_block_check_validate()
398 if (crc == bc_crc32e) in ocfs2_block_check_validate()
404 (unsigned int)bc_crc32e, (unsigned int)crc); in ocfs2_block_check_validate()
411 crc = crc32_le(~0, data, blocksize); in ocfs2_block_check_validate()
412 if (crc == bc_crc32e) { in ocfs2_block_check_validate()
418 (unsigned int)bc_crc32e, (unsigned int)crc); in ocfs2_block_check_validate()
[all …]
/Linux-v5.4/include/linux/
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-v5.4/arch/x86/crypto/
Dcrct10dif-pclmul_glue.c40 __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()
/Linux-v5.4/drivers/ipack/
Dipack.c268 static u16 ipack_crc_byte(u16 crc, u8 c) in ipack_crc_byte() argument
272 crc ^= c << 8; in ipack_crc_byte()
274 crc = (crc << 1) ^ ((crc & 0x8000) ? 0x1021 : 0); in ipack_crc_byte()
275 return crc; in ipack_crc_byte()
285 u16 crc; in ipack_calc_crc1() local
288 crc = 0xffff; in ipack_calc_crc1()
291 crc = ipack_crc_byte(crc, c); in ipack_calc_crc1()
293 crc = ~crc; in ipack_calc_crc1()
294 return crc & 0xff; in ipack_calc_crc1()
300 u16 crc; in ipack_calc_crc2() local
[all …]
/Linux-v5.4/lib/xz/
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()
/Linux-v5.4/drivers/nfc/nxp-nci/
Dfirmware.c76 u16 crc = 0xffff; in nxp_nci_fw_crc() local
79 crc = ((crc >> 8) | (crc << 8)) ^ *buffer++; in nxp_nci_fw_crc()
80 crc ^= (crc & 0xff) >> 4; in nxp_nci_fw_crc()
81 crc ^= (crc & 0xff) << 12; in nxp_nci_fw_crc()
82 crc ^= (crc & 0xff) << 5; in nxp_nci_fw_crc()
85 return crc; in nxp_nci_fw_crc()
91 u16 header, crc; in nxp_nci_fw_send_chunk() local
118 crc = nxp_nci_fw_crc(skb->data, chunk_len + NXP_NCI_FW_HDR_LEN); in nxp_nci_fw_send_chunk()
119 put_unaligned_be16(crc, skb_put(skb, NXP_NCI_FW_CRC_LEN)); in nxp_nci_fw_send_chunk()
283 u16 crc, frame_crc; in nxp_nci_fw_check_crc() local
[all …]
/Linux-v5.4/kernel/power/
Dswap.c681 struct crc_data *crc = NULL; in save_image_lzo() local
708 crc = kmalloc(sizeof(*crc), GFP_KERNEL); in save_image_lzo()
709 if (!crc) { in save_image_lzo()
714 memset(crc, 0, offsetof(struct crc_data, go)); in save_image_lzo()
737 init_waitqueue_head(&crc->go); in save_image_lzo()
738 init_waitqueue_head(&crc->done); in save_image_lzo()
741 crc->crc32 = &handle->crc32; in save_image_lzo()
743 crc->unc[thr] = data[thr].unc; in save_image_lzo()
744 crc->unc_len[thr] = &data[thr].unc_len; in save_image_lzo()
747 crc->thr = kthread_run(crc32_threadfn, crc, "image_crc32"); in save_image_lzo()
[all …]
/Linux-v5.4/tools/pcmcia/
Dcrc32hash.c15 unsigned int crc = 0; in crc32() local
17 crc ^= *p++; in crc32()
19 crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); in crc32()
21 return crc; in crc32()

12345678910>>...19