code wiki / _hdl_build / nx_media_crypt_wasm_gate.nx

nx_media_crypt_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_media_crypt_wasm_gate.nx

4600 B81 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic media
docsdependenciesstructsconstsfunctions

about

nx_media_crypt_wasm_gate.nx -- proves the sovereign ChaCha20 cipher runs CORRECTLY IN WASM: compile nx_media_crypt_wasm.nx -> wat -> wasm (sovereign pipeline), load in nx_wasm_vm, run RFC 8439 sec2.4.2 encryption in the VM's linear memory, compare to the standard's ciphertext. This is the browser lane, bit-identical to the native KAT. NISHI all the way (fork sovereign compilers -> nx_wasm_vm). ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_wasm_vm.nx nx_media_crypt.nx nx_media_crypt_wasm_gate.nx

imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_wasm_vm.nxnx_media_crypt.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write run_elf sys_fork sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_execve sys_exit ↻ sys_wait4 g_pn sys_mmap ↻ sys_write ↻ sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close g_check g_puts ↻ mw hexdec mc_hexval mr

structs

none

consts

10const CWAT: *u8 = "/tmp/nx_compile_wat.sov.elf"
11const WATC: *u8 = "/tmp/nx_wat_compiler.sov.elf"
12const SRCNX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_media_crypt_wasm.nx"
13const OWAT: *u8 = "/tmp/mcw.wat"
14const OWASM: *u8 = "/tmp/mcw.wasm"

functions

16func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
27func mw(mod: *WasmMod, addr: i64, byte: i64) -> i64 { let m: *u8 = ((mod.mem as i64)+addr) as *u8; m[0]=byte as u8; return 0 }
called by 1: main
28func mr(mod: *WasmMod, addr: i64) -> i64 { let m: *u8 = ((mod.mem as i64)+addr) as *u8; return m[0] & 0xff }
called by 1: main
29func hexdec(hex: *u8, nbytes: i64, out: *u8) -> i64
called by 1: main calls 1: mc_hexval
32func main() -> i64