nx_crc32c.nx
buildroot/runtime/nx_crc32c.nx
about
nx_crc32c.nx -- fast TABLE-driven CRC-32C (Castagnoli) for per-PDU
integrity: critical-grade table-stakes (BPv7 Type-2 CRC, RIST/SRT
integrity, FEC-block validation). Generalizes the shipped bit-by-bit
nx_crc32_v1.nx (CLAUDE.md 15 / review-existing-functionality) to the
256-entry byte-table lookup it flagged as future work -- the table is
BUILT AT RUNTIME from the polynomial (sidesteps the const-array-literal
gap), so it stays pure NishiLang, integer-only, zero deps.
CRC-32C: reflected polynomial 0x82F63B78, init/xorout 0xFFFFFFFF,
refin/refout true. Canonical check: crc32c("123456789") = 0xE3069283.
license_tier: ORIGINAL
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_crc32c_bench.nxnx_crc32c_test.nxnx_determinism.nx
structs
| none |
consts
| 16 | const CRC32C_POLY: i64 = 0x82F63B78 |
| 17 | const CRC_U32: i64 = 0xFFFFFFFF |
functions
| 20 | func crc32c_build_table() -> *i64 |
| 38 | func crc32c_table(t: *i64, bytes: *u8, n: i64) -> i64 |
| 52 | func crc32c_begin() -> i64 { return CRC_U32 } called by 1: main |
| 53 | func crc32c_update(t: *i64, state: i64, bytes: *u8, n: i64) -> i64 called by 1: main |
| 63 | func crc32c_final(state: i64) -> i64 { return state ^ CRC_U32 } called by 1: main |
| 68 | func crc32c_pdu_check(t: *i64, pdu: *u8, total_len: i64) -> i64 |