code wiki / _hdl_build / nx_pub_receipt_keys_gate.nx
nx_pub_receipt_keys_gate.nx
buildroot/runtime/_hdl_build/nx_pub_receipt_keys_gate.nx
about
nx_pub_receipt_keys_gate.nx -- referee for the publisher's stable receipt-signing identity (nx_pub_receipt_keys).
PROVES: generate-once (fresh -> 2; re-init -> 1, SAME priv) ; priv persisted 32 raw bytes, pub published 64 hex ;
the published pub round-trips ; CROSS-RUN: a message signed with the priv verifies with the PUBLISHED pub (so a
receipt is verifiable by anyone, durably) ; a different key does NOT verify ; the private seed NEVER leaks into the
published pubkey file. -> knowledge/status/pub_receipt_keys_gate.log.
dependencies 3 imports · 0 importers
imports: nx_pub_receipt_keys.nxnx_ed25519_signature.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 10 | func g_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 11 | func g_n(v: i64) -> i64 { var m: i64=v; if m<0{g_w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 12 | func gw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 13 | func gtrunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd>=0 { sys_close(fd) } return 0 } |
| 14 | func g_eq32(a: *u8, b: *u8) -> i64 { var i: i64=0; while i<32 { if a[i]!=b[i] {return 0} i=i+1 } return 1 } called by 1: main |
| 15 | func g_fsize(path: *u8) -> i64 { let lp: *i64=sys_mmap(8) as *i64; lp[0]=0; let d: *u8=sys_read_file(path,lp); if (d as i64)==0 {return 0} return lp[0] } |
| 16 | func g_has(buf: *u8, n: i64, needle: *u8, nl: i64) -> i64 { if nl==0{return 1} var i: i64=0; while i+nl<=n { var j: i64=0; var ok: i64=1; while j<nl { if buf[i+j]!=needle[j]{ok=0;j=nl} else {j=j+1} } if ok==1{return 1} i=i+1 } return 0 } called by 1: main |
| 17 | func g_hex(inp: *u8, n: i64, out: *u8) -> i64 { let hx: *u8="0123456789abcdef" as *u8; var i: i64=0; while i<n { out[i*2]=hx[((inp[i] as i64)>>4)&15]; out[i*2+1]=hx[(inp[i] as i64)&15]; i=i+1 } return n*2 } called by 1: main |
| 18 | func chk(got: i64, want: i64, label: *u8) -> i64 { g_w(" "); g_w(label); g_w(" got="); g_n(got); g_w(" want="); g_n(want); if got==want { g_w(" PASS\n"); return 1 } g_w(" FAIL\n"); return 0 } |
| 20 | func main() -> i64 |