code wiki / _hdl_build / nx_doc_crypto_gate.nx
nx_doc_crypto_gate.nx
buildroot/runtime/_hdl_build/nx_doc_crypto_gate.nx
about
nx_doc_crypto_gate.nx -- MEASURED hermetic gate for encryption-at-rest (nx_doc_crypto). Fresh nonce domain per
run (sys_now_realtime_sec) so it never depends on prior state. Proves the AEAD envelope + crypto-shred:
T1 round-trip : doc_encrypt -> doc_decrypt returns the plaintext BYTE-IDENTICAL
T2 tamper : a flipped ciphertext byte -> doc_decrypt FAILS (Poly1305 tag reject)
T3 wrong tenant : a different domain's DEK -> doc_decrypt FAILS (per-tenant isolation)
T4 crypto-shred : after crypto_shred, doc_decrypt FAILS (DEK destroyed) while the ciphertext bytes survive
Print pass=N/4 + GREEN/RED, append knowledge/status/dp_crypto_gate.log. STANDALONE -- no daemon touched.
(Diagnostic note: nx_chacha20_poly1305_decrypt writes a single 'A' to STDERR on its first call -- scratch-alloc
marker in the shipped AEAD; it does not affect stdout or the verdict.) license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_doc_crypto.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 12 | func g_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 |
| 13 | func g_num(v: i64) -> i64 called by 1: main |
| 19 | func g_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } called by 1: main |
| 20 | func g_wn(fd: i64, v: i64) -> i64 called by 1: main |
| 26 | func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 27 | func g_cat(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: main |
| 28 | func g_catnum(out: *u8, o: i64, v: i64) -> i64 called by 1: main |
| 34 | func g_eqbytes(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 |
| 36 | func main() -> i64 |