code wiki / _hdl_build / nx_fw_capstone_gate.nx

nx_fw_capstone_gate.nx

buildroot/runtime/_hdl_build/nx_fw_capstone_gate.nx

8364 B170 linesdepth 11pulls 16 transitivereach 0 importersview sourcekind gate/prooftopic fw
docsdependenciesstructsconstsfunctions

about

nx_fw_capstone_gate.nx -- the WHOLE-STACK never-brick capstone, on a REAL artifact, EXECUTED. Ties the entire arc together: the real _offc/nx_boot_uefi.efi is wrapped as SIGNED UEFI capsules (real EFI_CAPSULE_HEADER + ed25519, rung 11) into A/B banks + an immutable factory; selection is SIGNATURE-gated (uc_verify); a forged image planted in the active bank is rejected and the system falls back to a signed survivor, which is UNWRAPPED and ACTUALLY BOOTED in nx_emu_uefi (-> NISHI). C1 forged-active-survivor-boots : forged active -> signed survivor selected -> emu rc==0 (boots NISHI) C2 double-fault-signed-factory : forged A + garbage B -> the signed immutable factory is selected C3 all-forged-not-selectable : banks + factory all forged/garbage -> select null (never boot a forgery) GREEN only if all three hold. ONE emu fork (bounded reads keep fork cheap). The emu must be pre-built: ./_offc/nx_sov_build_run.elf nx_emu_uefi. Evidence -> knowledge/status/fw_capstone_gate.log. Sovereign: nx_fw_uefi_capsule (-> nx_fw_capsule -> nx_ed25519) + nx_framed_append + nx_syscalls. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_fw_uefi_capsule.nx nx_framed_append.nx nx_syscalls.nx nx_fw_capstone_gate.nx

imports: nx_fw_uefi_capsule.nxnx_framed_append.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 sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ cap_plat_seed uc_make sys_mmap ↻ uc_guid_write cp_wr_u32 ed25519_sign_full sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 sha512_gamma1 sha512_sigma1 sha512_ch sha512_k sha512_sigma0 sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch nx_scratch_init nx_scratch_oom sys_mmap ↻ fe_zero

structs

none

consts

19const CAP_LOG: *u8 = "knowledge/status/fw_capstone_gate.log"
20const REAL_EFI: *u8 = "_offc/nx_boot_uefi.efi"
21const EMU_ELF: *u8 = "/tmp/nx_emu_uefi.sov.elf"
22const CAP_A: i64 = 65
23const CAP_B: i64 = 66

functions

25func cap_copy(src: *u8, dst: *u8) -> i64
called by 1: main calls 2: sys_mmapcp_write
32func cap_garbage(path: *u8) -> i64
called by 1: main calls 2: sys_mmapcp_write
37func cap_write_sel(sel: *u8, c: i64) -> i64 { let b: *u8 = sys_mmap(2); b[0] = c as u8; b[1] = 0 as u8; cp_write(sel, b, 1); return 0 }
called by 1: main calls 2: sys_mmapcp_write
38func cap_read_sel(sel: *u8) -> i64
called by 1: cap_select calls 1: sys_mmap
49func cap_select(sel: *u8, ba: *u8, bb: *u8, fac: *u8) -> *u8
called by 1: main calls 2: cap_read_seluc_verify
57func cap_unwrap(capf: *u8, rawout: *u8) -> i64
called by 1: main calls 3: sys_mmapcp_rd_u32cp_write
69func cap_emu_boot(efi: *u8) -> i64
88func cap_row(name: *u8, pass: i64) -> i64
called by 1: main calls 2: sys_mmapfa_appendz
101func main() -> i64