code wiki / _hdl_build / nx_cms_argon_gate.nx

nx_cms_argon_gate.nx

buildroot/runtime/_hdl_build/nx_cms_argon_gate.nx

12725 B311 linesdepth 5pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic cms
docsdependenciesstructsconstsfunctions

about

nx_cms_argon_gate.nx -- CMS C10 GATE (re-runnable, evidence-driven): argon2id admin credentials at the wire. Site fixture carries admin_pw.ar2 (self-describing params; gate uses m=8192 t=3 to stay brisk -- production = the vault's measured m=32768, the FILE decides) PLUS a deliberately VALID legacy admin_pw.sha256 for a DIFFERENT password: the gate proves the legacy file cannot bypass when .ar2 is present (no downgrade), wrong pw refused, right pw verifies memory-hard, lockout still enforced. Appends "CMSGATE row=nx_cms_argon ... verdict=PASS|FAIL". Exit 0 iff all rows pass. license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_cms_pw.nx nx_connect.nx nx_cms_store.nx nx_sha256.nx nx_kill_portable.nx nx_cms_argon_gate.nx

imports: nx_cms_pw.nxnx_connect.nxnx_cms_store.nxnx_sha256.nxnx_kill_portable.nx

imported by: nobody (leaf or entry point)

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

main ag_mkdir cst_copy sys_openat_rd sys_openat_wr sys_close sys_mmap sys_read sys_write sys_renameat cpw_write cpw_ctx_new sys_mmap ↻ sys_mmap ↻ cpw_derive sys_mmap ↻ nx_argon2id_hash _ar2_h0 _ar2_write_le32 nx_blake2b_hash nx_blake2b_init nx_blake2b_update nx_blake2b_final _ar2_block_at nx_blake2b_long _b2bl_write_le32 nx_blake2b_hash ↻ _b2bl_copy _ar2_gen_address_block _ar2_write_le64 nx_argon2_g _a2b_load_u64_le _a2b_p _a2b_store_u64_le _ar2_load_u64_le _ar2_map_index _ar2_lshr32 nx_argon2_g ↻ _ar2_block_xor_into _ar2_block_copy

structs

none

consts

14const AG_PORT: i64 = 8082
15const AG_SITE: *u8 = "/tmp/_cms_ar2_site"
16const AG_M_KIB: i64 = 8192 // gate-speed param, recorded IN the fixture file (rule 11: data not code)
17const AG_T: i64 = 3

functions

19func ag_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: ag_rowmain
20func ag_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: ag_indexag_post
21func ag_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 3: ag_postag_getmain
27func ag_catn(dst: *u8, off: i64, s: *u8, n: i64) -> i64
called by 2: ag_postag_get
33func ag_index(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: ag_hasmain calls 1: ag_len
45func ag_has(hay: *u8, n: i64, needle: *u8) -> i64 { if ag_index(hay, n, needle) >= 0 { return 1 } return 0 }
called by 1: main calls 1: ag_index
47func ag_http(req: *u8, rl: i64, resp: *u8, cap: i64) -> i64
81func ag_post(req: *u8, path: *u8, cookie: *u8, body: *u8) -> i64
called by 1: main calls 3: ag_catag_catnag_len
103func ag_get(req: *u8, path: *u8, cookie: *u8) -> i64
called by 1: main calls 2: ag_catag_catn
116func ag_row(id: i64, ok: i64, what: *u8) -> i64
called by 1: main calls 1: ag_w
126func ag_mkdir(path: *u8, mode: i64) -> i64
called by 1: main
132func main() -> i64