code wiki / (root) / nx_zip_gate.nx

nx_zip_gate.nx

buildroot/runtime/nx_zip_gate.nx

7195 B172 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic zip
docsdependenciesstructsconstsfunctions

about

nx_zip_gate.nx -- proves the ZIP writer/reader pair by ROUND-TRIP. T1 pins the CRC ALGORITHM to the classic check value 0xCBF43926 for "123456789". This matters more than usual here: nx_ogg.nx also implements something called "CRC-32", using the SAME polynomial UNreflected with zero init. The two are not interchangeable, and swapping them produces archives that round-trip perfectly against themselves while every unzip on earth reports a checksum error. Only an absolute known-value assertion separates them. T5 pins the central-directory offset. Readers trust the CD, not the local headers -- an archive with correct local headers and wrong CD offsets opens as empty or corrupt, and nothing in the local headers hints at it. The test resolves each entry's data THROUGH the CD offset and verifies the CRC of what it finds there. NON-VACUITY: T7 covers refusals -- a corrupted data byte must fail CRC, a short buffer must refuse, and a missing EOCD must not be invented. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_zip.nx nx_zip_gate.nx

imports: nx_syscalls.nxnx_zip.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

24func g_puts(s: *u8) -> i64
31func g_putn(v: i64) -> i64
44func main() -> i64