code wiki / _hdl_build / nx_email_send_gate.nx

nx_email_send_gate.nx

buildroot/runtime/_hdl_build/nx_email_send_gate.nx

4188 B95 linesdepth 11pulls 19 transitivereach 0 importersview sourcekind gate/prooftopic email
docsdependenciesstructsconstsfunctions

about

nx_email_send_gate.nx -- GATE for outbound DKIM send (nx_email_send). COMPLETENESS : compose a message, DKIM ed25519-sha256 sign it, and verify the signature validates against the public key. TAMPER : flip a BODY byte -> verify fails (bh mismatch); flip a signed HEADER byte -> verify fails (sig mismatch). NEG-CONTROL : verify under a DIFFERENT public key -> fails (it truly checks the signature, not just structure). Evidence -> knowledge/status/email_send.log (SENDGATE ... verdict=GREEN) license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_email_send.nx nx_csprng.nx nx_syscalls.nx nx_email_send_gate.nx

imports: nx_email_send.nxnx_csprng.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_mmap nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close ed25519_pub_from_priv 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 rotr64_v shr64_v sha512_gamma1 rotr64_v ↻ shr64_v ↻ sha512_sigma1 rotr64_v ↻ sha512_ch sha512_k sha512_sigma0 rotr64_v ↻ sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch

structs

none

consts

16const SEND_LOG: *u8 = "knowledge/status/email_send.log"

functions

18func ew(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 2: epfmain calls 1: sys_write
19func epf(fd: i64, label: *u8, pass: i64) -> i64 { ew(fd, label); if pass == 1 { ew(fd, "PASS" as *u8) } else { ew(fd, "FAIL" as *u8) } return 0 }
called by 1: main calls 1: ew
20func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: g_find
21func cp(dst: *u8, src: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { dst[i] = src[i]; i = i + 1 } return 0 }
called by 1: main
22func g_find(hay: *u8, hlen: i64, needle: *u8) -> i64
called by 2: containsmain calls 1: slen
32func contains(hay: *u8, hlen: i64, needle: *u8) -> i64 { if g_find(hay, hlen, needle) >= 0 { return 1 } return 0 }
called by 1: main calls 1: g_find
34func main() -> i64