1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! CRC kernel function type definitions.
//!
//! This module provides the function signature types used by kernel dispatch tables.
// ─────────────────────────────────────────────────────────────────────────────
// CRC-16 Kernel Function Type
// ─────────────────────────────────────────────────────────────────────────────
/// Function signature for CRC-16 kernels.
///
/// Used by CRC-16-CCITT, CRC-16-IBM, CRC-16-USB, and other 16-bit CRC variants.
///
/// # Arguments
///
/// * `state` - Current CRC state (typically initialized to 0xFFFF or 0x0000)
/// * `data` - Input data to process
///
/// # Returns
///
/// Updated CRC state after processing the input data.
pub type Crc16Fn = fn ;
// ─────────────────────────────────────────────────────────────────────────────
// CRC-24 Kernel Function Type
// ─────────────────────────────────────────────────────────────────────────────
/// Function signature for CRC-24 kernels.
///
/// Used by CRC-24 (OpenPGP/Radix-64). The result is a 24-bit value stored
/// in the low 24 bits of a u32.
///
/// # Arguments
///
/// * `state` - Current CRC state (only low 24 bits are used)
/// * `data` - Input data to process
///
/// # Returns
///
/// Updated CRC state with the result in the low 24 bits.
pub type Crc24Fn = fn ;
// ─────────────────────────────────────────────────────────────────────────────
// CRC-32 Kernel Function Type
// ─────────────────────────────────────────────────────────────────────────────
/// Function signature for CRC-32 kernels.
///
/// Used by:
/// - CRC-32 (IEEE)
/// - CRC-32C (Castagnoli)
///
/// # Hardware Acceleration
///
/// - **x86_64**: SSE4.2 `crc32` (CRC-32C only), PCLMULQDQ, VPCLMULQDQ
/// - **aarch64**: ARMv8 CRC extension, PMULL, PMULL+EOR3
///
/// # Arguments
///
/// * `state` - Current CRC state (typically initialized to 0xFFFFFFFF)
/// * `data` - Input data to process
///
/// # Returns
///
/// Updated CRC state after processing the input data.
pub type Crc32Fn = fn ;
// ─────────────────────────────────────────────────────────────────────────────
// CRC-64 Kernel Function Type
// ─────────────────────────────────────────────────────────────────────────────
/// Function signature for CRC-64 kernels.
///
/// Used by:
/// - CRC-64-XZ (ECMA-182) - XZ Utils, 7-Zip
/// - CRC-64-NVME - NVMe specification
/// - CRC-64-GO-ISO - Go standard library
///
/// # Hardware Acceleration
///
/// - **x86_64**: PCLMULQDQ, VPCLMULQDQ
/// - **aarch64**: PMULL, PMULL+EOR3
///
/// # Arguments
///
/// * `state` - Current CRC state (typically initialized to 0xFFFFFFFFFFFFFFFF)
/// * `data` - Input data to process
///
/// # Returns
///
/// Updated CRC state after processing the input data.
pub type Crc64Fn = fn ;