code wiki / (root) / nx_ice_gate.nx

nx_ice_gate.nx

buildroot/runtime/nx_ice_gate.nx

5619 B98 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic ice
docsdependenciesstructsconstsfunctions

about

nx_ice_gate.nx -- KAT the sovereign ICE primitives against RFC 8445 (priority) + RFC 5769 (2.1 sample request, byte-exact). GREEN => a Nishi endpoint builds ICE connectivity checks that interoperate with any standard peer, from the first byte up, no third-party code. T0 header parse: Binding Request, magic, length 0x58 T1 candidate priority: ic_priority(host=126, local=65535, comp=1) == 0x7EFFFFFF (RFC 8445 host example) T2 candidate priority: ic_priority(prflx=110, local=1, comp=1) == 0x6E0001FF (the RFC 5769 2.1 value) T3 build the full connectivity-check request -> 108 bytes BYTE-EXACT vs RFC 5769 2.1 (incl MI + FINGERPRINT) T4 candidate-pair priority comparator orders pairs + honours the controlling>controlled tie-break T5 USE-CANDIDATE is a zero-length flag attribute license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_ice.nx nx_ice_gate.nx

imports: nx_syscalls.nxnx_ice.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap gw sys_write hexdec hxv st_type st_get16 st_magic st_get32 gck gw ↻ ic_priority gxh gw ↻ sys_mmap ↻ sys_write ↻ ic_build_check st_write_header st_put16 st_put32 ic_write_attr st_put16 ↻ ic_write_priority st_put16 ↻ st_put32 ↻ ic_write_role st_put16 ↻ st_put16 ↻ sys_mmap ↻ st_message_integrity hmac_sha1 sys_mmap ↻ sha1 sys_mmap ↻ sha1_process_block if_ge st_fingerprint nx_crc32 st_put32 ↻

structs

none

consts

none

functions

14func gw(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 3: gxhgckmain calls 1: sys_write
15func gn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
20func gxh(v: i64) -> i64 { gw("0x" as *u8); let d: *u8="0123456789abcdef" as *u8; let b: *u8=sys_mmap(16); var i: i64=7; while i>=0 { b[7-i]=d[(v>>(i*4))&0xf]; i=i-1 } sys_write(1,b,8); return 0 }
called by 1: main calls 3: gwsys_mmapsys_write
21func gck(pass: i64, name: *u8, fails: *i64) -> i64
called by 1: main calls 1: gw
25func hxv(c: i64) -> i64
called by 1: hexdec
31func hexdec(hex: *u8, nbytes: i64, out: *u8) -> i64 { var i: i64=0; while i<nbytes { out[i]=((hxv(hex[i*2] as i64)<<4) | hxv(hex[i*2+1] as i64)) as u8; i=i+1 } return 0 }
called by 1: main calls 1: hxv
32func beq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: main
34func main() -> i64