code wiki / _hdl_build / nx_vc_fecrx_fuzz_gate.nx

nx_vc_fecrx_fuzz_gate.nx

buildroot/runtime/_hdl_build/nx_vc_fecrx_fuzz_gate.nx

12966 B245 linesdepth 7pulls 20 transitivereach 0 importersview sourcekind gate/prooftopic vc
docsdependenciesstructsconstsfunctions

about

nx_vc_fecrx_fuzz_gate.nx -- ADVERSARIAL memory-safety proof for vc_fecrx_add, the FEC reassembly parser on the LIVE family-video path (operator: "s class exceed ... permanent gains require pain"). Every shard header field (block_id/idx/k/m/flen) is ATTACKER-CONTROLLED (a peer's bytes over the content-blind relay). A green build shipping an exploitable parse is worse than none -> this PROVES no hostile shard can write outside the caller regions. Method: allocate st/scratchA/scratchSh/out at the EXACT deployed-client sizes, wrap each in 0xAA CANARY guard bands, throw 60000 hostile inputs + boundary cases + a real accumulate, and assert EVERY guard byte is pristine after EVERY call. NEG-control proves the detector isn't tautological (a deliberate guard poke MUST read as breached). Evidence -> knowledge/status/vc_fecrx_fuzz.log. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_video_client_wasm.nx nx_vc_fecrx_fuzz_gate.nx

imports: nx_syscalls.nxnx_video_client_wasm.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main fp sys_write sys_mmap vc_fec_init vc_gf_inv galloc sys_mmap ↻ vc_fecrx_reset lcg vc_fecrx_add vc_fec_decode vc_gf_inv ↻ vc_gf_mul gok fn sys_mmap ↻ sys_write ↻ vc_fecs_shard_size vc_fecs_pack vc_fec_encode vc_gf_mul ↻ sys_openat_append sys_write ↻ sys_close

structs

none

consts

13const GUARD: i64 = 8192
14const USABLE: i64 = 65536 // the deployed client's per-region size (0x10000 slots)
15const OUTCAP: i64 = 65280 // the client passes B(0xFF00); n*S bound -> S<=6528, flen<=52224

functions

17func fp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
18func fn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
22func lcg(s: *i64) -> i64 { s[0]=(s[0]*1103515245+12345) & 0x7fffffff; return s[0] }
called by 1: main
26func galloc(usable: i64, g: *i64) -> i64
called by 1: main calls 1: sys_mmap
40func gok(g: *i64) -> i64
called by 1: main
48func main() -> i64