code wiki / _hdl_build / nx_poly1305_pow_gate.nx
nx_poly1305_pow_gate.nx
buildroot/runtime/_hdl_build/nx_poly1305_pow_gate.nx
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
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
structs
| none |
consts
| 8 | const POLY_LOG: *u8 = "knowledge/status/poly1305.log" |
functions
| 10 | func u8to32(p: *u8, o: i64) -> i64 called by 1: clamp_r |
| 15 | func poly_mul(x: *i64, y: *i64, ys: *i64, out: *i64) -> i64 called by 1: main |
| 37 | func clamp_r(key: *u8, r: *i64) -> i64 |
| 50 | func times5(x: *i64, xs: *i64) -> i64 called by 1: main |
| 55 | func 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 } |
| 56 | func pwn(fd: i64, v: i64) -> i64 |
| 65 | func print5(fd: i64, p: *i64) -> i64 |
| 72 | func eb(fd: i64, v: i64) -> i64 |
| 78 | func emit_bc(fd: i64, label: *u8, v: i64) -> i64 |
| 87 | func emit_lane(fd: i64, label: *u8, v0: i64, v1: i64, v2: i64, v3: i64) -> i64 |
| 94 | func emit(fd: i64, r: *i64, r2: *i64, r3: *i64, r4: *i64, ok: i64) -> i64 |
| 104 | func main() -> i64 |