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
//! Helpers for CRC-24/OPENPGP acceleration via a reflected width32 domain.
//!
//! CRC-24/OPENPGP is specified as MSB-first, but the accelerated kernels reuse
//! the reflected "width32" folding/reduction structure by:
//! - Lifting CRC-24 into the top 24 bits of a 32-bit register (low 8 bits = 0),
//! - Converting to a reflected CRC32 domain by bit-reversing each input byte,
//! - Converting back after folding.
// SAFETY: All array indexing in this module uses bounded indices:
// - Table generation iterates i: 0..256 into a [u32; 256]
// - Table lookups use `& 0xFF` which produces indices 0..255
use CRC24_OPENPGP_POLY_REFLECTED;
const MASK24: u32 = 0x00FF_FFFF;
pub const
pub const
/// Generate a reflected CRC-32 table entry (LSB-first) for one byte.
const
const
const CRC32_REFLECTED_TABLE: = generate_crc32_reflected_table;
/// Update a reflected CRC32-domain state with `data`, bit-reversing each byte.
pub