code wiki / _hdl_build / nx_social_recovery_gate.nx

nx_social_recovery_gate.nx

buildroot/runtime/_hdl_build/nx_social_recovery_gate.nx

3571 B82 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic social
docsdependenciesstructsconstsfunctions

about

nx_social_recovery_gate.nx -- REFEREE for elderly-friendly social recovery (N=3 contacts, K=2 quorum over a 256-bit secret). Security code MUST prove the quorum holds AND that less-than-quorum learns nothing. T1 contacts {1,2} reconstruct == secret T4 a single share (K-1) != secret (no quorum -> nothing) T2 contacts {1,3} reconstruct == secret T5 a tampered share != secret (one bad share = garbage) T3 contacts {2,3} reconstruct == secret GREEN iff T1..T5. Sovereign: nx_social_recovery + nx_vault_shamir + nx_csprng + nx_syscalls. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_social_recovery.nx nx_syscalls.nx nx_social_recovery_gate.nx

imports: nx_social_recovery.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main g_w sys_write sys_mmap nx_sr_split sr_chunk_nbytes sys_mmap ↻ sr_pack nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close sh_mod sh_eval sh_add sh_mod ↻ sh_mul sh_mod ↻ sys_exit g_pick2 nx_sr_reconstruct sys_mmap ↻ sh_reconstruct sh_mul ↻ sh_sub sh_mod ↻ sh_inv sh_mod ↻ sh_add ↻ sr_unpack sr_chunk_nbytes ↻ g_row g_w ↻ g_eq32

structs

none

consts

none

functions

10func 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 }
called by 2: g_rowmain calls 1: sys_write
11func g_row(name: *u8, ok: i64) -> i64
called by 1: main calls 1: g_w
18func g_eq32(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while i < SR_KEY_BYTES { if (a[i] as i64) != (b[i] as i64) { return 0 } i = i + 1 } return 1 }
called by 1: main
21func g_pick2(shares: *i64, a: i64, b: i64, xs: *i64, sin: *i64) -> i64
called by 1: main
33func main() -> i64