nx_bt_v2_merkle_gate.nx
buildroot/runtime/nx_bt_v2_merkle_gate.nx
about
nx_bt_v2_merkle_gate.nx -- proves the BitTorrent v2 SHA-256 merkle tree + inclusion proofs: build a root over 4
blocks, prove ONE block belongs to the root with log2(n) siblings (verifiable random access), and show tamper
detection + wrong-proof rejection. expect_exit: 0 license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_bt_v2_merkle.nxnx_sha256.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
| 8 | func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 9 | func g_ck(name: *u8, cond: i64, st: *i64) -> i64 { st[1]=st[1]+1; if cond==1 { st[0]=st[0]+1; g_puts(" [OK] " as *u8) } else { g_puts(" [FAIL] " as *u8) } g_puts(name); g_puts("\n" as *u8); return 0 } |
| 10 | func g_hex(b: *u8, n: i64) -> i64 { let hx: *u8="0123456789abcdef" as *u8; var i: i64=0; while i<n { let o: *u8=sys_mmap(2); o[0]=hx[((b[i] as i64)>>4)&15]; o[1]=hx[(b[i] as i64)&15]; sys_write(1,o,2); i=i+1 } return 0 } |
| 11 | func lp(leaves: *u8, i: i64) -> *u8 { return (leaves as i64 + i*32) as *u8 } called by 1: main |
| 13 | func main() -> i64 |