code wiki / _hdl_build / nx_x25519_extvec_gate.nx

nx_x25519_extvec_gate.nx

buildroot/runtime/_hdl_build/nx_x25519_extvec_gate.nx

7966 B187 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic x25519
docsdependenciesstructsconstsfunctions

about

nx_x25519_extvec_gate.nx -- THE FIRST PROVABLY THIRD-PARTY-VALIDATED CLAIM. Proven GREEN on the laptop 2026-07-31 (pass=2 fail=0). Shipped here so it runs where claims are served. Every other KAT in this corpus embeds its expected values as constants a developer copied out of a specification. Honest work, but NOT provably external: nothing in the artifact distinguishes a value transcribed from the IETF from one an author -- or an AGENT -- merely believed. This gate closes that: 1 it reads the vectors FROM knowledge/extvec/rfc7748.txt AT RUN TIME. NO expected value appears in this source at all, so there is nothing here for anyone to have mistyped or invented. 2 it PINS the acquisition digest: the file must sha256 to the value nx_vecfetch computed IN-PROCESS, at the socket, before the bytes ever touched disk. Edited, truncated or substituted -> pin fails. 3 only then does it run x25519() and compare. THE PIN IS THE SECURITY PROPERTY, NOT THE RUN-TIME PARSE. Parsing from a file is necessary but NOT sufficient: an agent could edit the fetched file to contain whatever answers make its implementation pass, and the parse would faithfully read the forgery. Pinning to an ACQUISITION-TIME digest is what turns "we read it from a file" into evidence. AND THE PIN MAKES TRANSPORT UNTRUSTED-BUT-VERIFIED: whoever carries rfc7748.txt to this host -- scp, an agent, a USB stick -- cannot corrupt it undetected, because sha256 preimage resistance means bytes that hash to ab200228.. ARE the fetched bytes. The carrier never has to be trusted. That is the whole point of content-addressing, and it is why this gate is safe to ship even though its data file is not. TO MAKE IT GREEN HERE: place knowledge/extvec/rfc7748.txt (any byte-exact copy; the pin checks it), or build+run nx_vecfetch on this host. Until then it reports RED-and-honest: absent file, never a fallback to constants. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_sha256_wasm.nx nx_x25519.nx nx_x25519_extvec_gate.nx

imports: nx_syscalls.nxnx_sha256_wasm.nxnx_x25519.nx

imported by: nobody (leaf or entry point)

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

main w sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_sha256_one_shot _h_set _sha256_compress _blk_word_be _rotr32 _h_get _sha256_k _h_set ↻ _h_get ↻ hexnib wb sys_write ↻ findfrom starts parse32 hexval x25519 nx_scratch_save nx_scratch_init sys_mmap ↻ nx_scratch nx_scratch_init ↻ nx_scratch_oom sys_write ↻ sys_exit sys_mmap ↻ fe_alloc nx_scratch ↻ fe_from_bytes fe_one

structs

none

consts

none

functions

29func 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: nnmain calls 1: sys_write
30func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 }
called by 1: main calls 1: sys_write
32func nn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
46func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v }
called by 1: main
48func hexval(c: i64) -> i64
called by 1: parse32
55func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64
called by 1: findfrom
65func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64
called by 1: main calls 1: starts
76func parse32(b: *u8, n: i64, from: i64, out: *u8) -> i64
called by 1: main calls 1: hexval
101func eq32(a: *u8, b: *u8) -> i64
called by 1: main
107func main() -> i64