code wiki / _hdl_build / nx_cmos_signed.nx

nx_cmos_signed.nx

buildroot/runtime/_hdl_build/nx_cmos_signed.nx

3600 B64 linesdepth 10pulls 15 transitivereach 1 importersview sourcekind tooltopic cmos
docsdependenciesstructsconstsfunctions

about

nx_cmos_signed.nx -- AUTHENTICATED CMOS config recovery (rung 7 CMOS x rung 8 capsule). module: nishi-core.genealogy.cmos_signed capability: CORE_COMPUTE (recover CMOS only from a platform-SIGNED golden snapshot) nx_cmos kept a golden snapshot for restore -- but a checksum-valid golden could still be a TAMPERED or FORGED config. Here the golden snapshot is a platform-SIGNED capsule (the 128-byte CMOS image is the ed25519-signed payload). cmos_restore_signed restores ONLY IF: the golden's signature verifies against the trusted platform key AND the payload is a CMOS image AND its AT checksum is valid. So config recovery is AUTHENTIC -- a forged/tampered golden cannot brick you with a bad config. Sandboxed/in-memory. Sovereign: nx_cmos + nx_fw_capsule (-> nx_ed25519) + nx_syscalls. license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_cmos.nx nx_fw_capsule.nx nx_syscalls.nx nx_cmos_signed.nx nx_cmos_signed_gate.nx

imports: nx_cmos.nxnx_fw_capsule.nxnx_syscalls.nx

imported by: nx_cmos_signed_gate.nx

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

main c_puts sys_write sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ cap_plat_seed cmos_golden cmos_fix cmos_cksum cap_path cp_cat cp_catn sys_mmap ↻ cmos_golden_capsule cap_make sys_mmap ↻ cp_wr_u32 ed25519_sign_full sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_blk_set_byte sha512_compress sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch fe_zero ed25519_basepoint_p3 sys_mmap ↻ ge_p3_decompress sys_mmap ↻ fe_from_bytes

structs

none

consts

16const CS_REFUSED: i64 = 0 - 1

functions

19func cmos_golden_capsule(path: *u8, img: *u8, seed: *u8) -> i64
called by 2: mainmain calls 1: cap_make
26func cmos_restore_signed(working: *u8, golden_cap: *u8) -> i64
40func main() -> i64