code wiki / _hdl_build / nx_vault_transit_test.nx

nx_vault_transit_test.nx

buildroot/runtime/_hdl_build/nx_vault_transit_test.nx

5119 B83 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic vault
docsdependenciesstructsconstsfunctions

about

nx_vault_transit_test.nx -- TRANSITGATE: proves the sovereign transit engine (encryption-as-a-service) with REAL AES-128-GCM. GREEN iff: encrypt->decrypt roundtrips; the envelope stamps the key version; after rotation an OLD-version envelope still decrypts (versioned keyring); rewrap re-encrypts an old envelope to the latest version (ciphertext CHANGES, plaintext preserved, caller gets no plaintext); tamper FAILS CLOSED; and version routing works (encrypt v2 -> decrypt routes to v2). exit 0 on 7/7.

dependencies 2 imports · 0 importers

nx_vault_transit.nx nx_syscalls.nx nx_vault_transit_test.nx

imports: nx_vault_transit.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 tt_puts sys_write sys_mmap tt_fill tr_encrypt sys_mmap ↻ nx_aes128_gcm_seal sys_mmap ↻ aes128_expand_key _aes_sbox _aes_rcon aes128_encrypt_block nx_ghash_reflect16 gh_byterev_bits gh_revtab sys_mmap ↻ gh_revbyte nx_ghash_mul_rev gh_clmul_core gh_scratch sys_mmap ↻ gh_clmul_mul256_acc gh_scratch ↻ gh_clmul_reduce256 gh_lshr nx_ghash_upd_rev gh_rev_scratch sys_mmap ↻ gh_byterev_bits ↻ gh_clmul_core ↻ nx_aes128_gcm_inc32 gcm_ctr_store nx_aes128_gcm_inc32 ↻ nx_ghash_upd_rev4 gh_agg_scratch sys_mmap ↻ gh_byterev_bits ↻ gh_clmul_mul256_acc ↻ gh_clmul_reduce256 ↻

structs

none

consts

none

functions

9func tt_puts(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 1: main calls 1: sys_write
10func tt_num(v: i64) -> i64 { let b: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var i: i64=0; while i<k {b[i]=t[k-1-i]; i=i+1}; sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
11func tt_eq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
12func tt_fill(buf: *u8, val: i64, n: i64) -> i64 { var i: i64 = 0; while i < n { buf[i] = val as u8; i = i + 1 } return 0 }
called by 1: main
14func main() -> i64