code wiki / _hdl_build / nx_poly1305_pow_gate.nx

nx_poly1305_pow_gate.nx

buildroot/runtime/_hdl_build/nx_poly1305_pow_gate.nx

6706 B144 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic poly1305
docsdependenciesstructsconstsfunctions

about

nx_poly1305_pow_gate.nx -- compute + verify the Poly1305 key powers r, r^2, r^3, r^4 (mod 2^130-5), the precomputed multipliers the 4-way SIMD Poly1305 kernel needs (lanes multiplied by [r^4,r^3,r^2,r^1]). Uses the SAME 5x26-bit-limb multiply as the verified scalar reference (nx_poly1305_gate). Prints the limbs (to embed in the SIMD .s) and CROSS-CHECKS r^4 two independent ways (r^2*r^2 == r^3*r) = a liar-kill that the multiply is consistent. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_poly1305_pow_gate.nx

imports: nx_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 clamp_r u8to32 times5 poly_mul emit_bc pw sys_write eb pwn sys_mmap ↻ sys_write ↻ pw ↻ pw ↻ eb ↻ emit_lane pw ↻ eb ↻ emit pw ↻ print5 pwn ↻ pw ↻ pwn ↻ sys_openat_append sys_close

structs

none

consts

8const POLY_LOG: *u8 = "knowledge/status/poly1305.log"

functions

10func u8to32(p: *u8, o: i64) -> i64
called by 1: clamp_r
15func poly_mul(x: *i64, y: *i64, ys: *i64, out: *i64) -> i64
called by 1: main
37func clamp_r(key: *u8, r: *i64) -> i64
called by 1: main calls 1: u8to32
50func times5(x: *i64, xs: *i64) -> i64
called by 1: main
55func pw(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 }
56func pwn(fd: i64, v: i64) -> i64
called by 3: print5ebemit calls 2: sys_mmapsys_write
65func print5(fd: i64, p: *i64) -> i64
called by 1: emit calls 2: pwnpw
72func eb(fd: i64, v: i64) -> i64
called by 3: emit_bcemit_lanemain calls 2: pwnpw
78func emit_bc(fd: i64, label: *u8, v: i64) -> i64
called by 1: main calls 2: pweb
87func emit_lane(fd: i64, label: *u8, v0: i64, v1: i64, v2: i64, v3: i64) -> i64
called by 1: main calls 2: pweb
94func emit(fd: i64, r: *i64, r2: *i64, r3: *i64, r4: *i64, ok: i64) -> i64
called by 1: main calls 3: pwprint5pwn
104func main() -> i64