code wiki / _hdl_build / nx_coe_consistency.nx
nx_coe_consistency.nx
buildroot/runtime/_hdl_build/nx_coe_consistency.nx
about
nx_coe_consistency.nx -- CHAIN-OF-EVIDENCE CONSISTENCY PROOF (F713 consistency clause, seq135)
Proves the transparency log only APPENDED, never rewrote: for every published signed-tree-head
(root, leaves=m) in coe_witness.log, recompute the Merkle root over the FIRST m leaves of the
CURRENT signed chain and require it equals the recorded root, and require m is non-decreasing.
A match across all STHs => the log is append-only (no prefix was ever altered). Any mismatch =>
RED (rewrite/tamper detected). This is the RFC-6962 consistency property, sovereign.
Composes proven libs only: nx_str/nx_syscalls/nx_sha256. x86-lane. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_str.nxnx_syscalls.nxnx_estate_path.nxnx_sha256.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
| 13 | const CC_CAP: i64 = 1048576 |
| 14 | const CC_MAXLEAF: i64 = 4096 |
functions
| 16 | func cc_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 } |
| 17 | func cc_pi(v: i64) -> i64 |
| 29 | func cc_nib(c: i64) -> i64 { if c >= 97 { return c - 87 } return c - 48 } called by 1: cc_unhex32 |
| 30 | func cc_line_end(b: *u8, i0: i64, n: i64) -> i64 { var e: i64 = i0; while e < n { if b[e] == (10 as u8) { return e } e = e + 1 } return n } called by 1: main |
| 31 | func cc_find_tab(b: *u8, i0: i64, e: i64) -> i64 { var j: i64 = i0; while j < e { if b[j] == (9 as u8) { return j } j = j + 1 } return e } called by 1: main |
| 32 | func cc_cp32(dst: *u8, src: *u8) -> i64 { var i: i64 = 0; while i < 32 { dst[i] = src[i]; i = i + 1 } return 0 } called by 1: cc_root |
| 33 | func cc_eq32(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while i < 32 { if a[i] != b[i] { return 0 } i = i + 1 } return 1 } called by 1: main |
| 34 | func cc_pair(l: *u8, r: *u8, out: *u8) -> i64 |
| 43 | func cc_unhex32(src: *u8, off: i64, out: *u8) -> i64 |
| 54 | func cc_atoi(b: *u8, off: i64, end: i64) -> i64 called by 1: main |
| 65 | func cc_root(leaves: *u8, k: i64, lvl: *u8, nxt: *u8, out: *u8) -> i64 |
| 89 | func cc_cats(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } called by 1: main |
| 90 | func cc_catn(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8 = sys_mmap(32); var m: i64 = v; var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { dst[off+i] = t[k-1-i]; i = i + 1 } return off + k } |
| 92 | func main() -> i64 |