code wiki / (root) / nx_crc32c.nx

nx_crc32c.nx

buildroot/runtime/nx_crc32c.nx

2907 B78 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_crc32c.nx nx_crc32c_bench.nx nx_crc32c_test.nx nx_determinism.nx

imports: nx_syscalls.nx

imported by: nx_crc32c_bench.nxnx_crc32c_test.nxnx_determinism.nx

structs

none

consts

16const CRC32C_POLY: i64 = 0x82F63B78
17const CRC_U32: i64 = 0xFFFFFFFF

functions

20func crc32c_build_table() -> *i64
called by 3: mainmainmain calls 1: sys_mmap
38func crc32c_table(t: *i64, bytes: *u8, n: i64) -> i64
52func crc32c_begin() -> i64 { return CRC_U32 }
called by 1: main
53func crc32c_update(t: *i64, state: i64, bytes: *u8, n: i64) -> i64
called by 1: main
63func crc32c_final(state: i64) -> i64 { return state ^ CRC_U32 }
called by 1: main
68func crc32c_pdu_check(t: *i64, pdu: *u8, total_len: i64) -> i64
called by 1: main calls 1: crc32c_table