code wiki / _hdl_build / nx_poly1305_gate.nx
nx_poly1305_gate.nx
buildroot/runtime/_hdl_build/nx_poly1305_gate.nx
about
nx_poly1305_gate.nx -- GATE for the SCALAR Poly1305 reference (the MAC half of the room's
ChaCha20-Poly1305 AEAD). Proves, by RUNNING, byte-exact against the RFC-8439 ยง2.5.2 test
vector. This is the CORRECTNESS FOUNDATION for the SIMD Poly1305 exceed (same 5x26-bit limb
layout the AVX2 kernel will vectorize over powers of r). poly1305-donna 32-bit algorithm,
5 limbs of 26 bits each, products fit i64 (no 128-bit/mulq needed).
TWO GATES:
A RFC KAT: tag("Cryptographic Forum Research Group", rfc-key) == a8061dc1...27a9 (byte-exact).
B LIAR-KILL: flip one message byte -> tag MUST differ from the RFC tag (kills a hardcoded cheat).
genealogy_id: bernstein_2005_poly1305 (realized_in nx_poly1305)
lineage_id: sovereign_poly1305_scalar_26bit_limb_v1
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
| 16 | const POLY_LOG: *u8 = "knowledge/status/poly1305.log" |
functions
| 19 | func u8to32(p: *u8, o: i64) -> i64 |
| 25 | func poly_block(m: *u8, off: i64, hibit: i64, h: *i64, r: *i64, s: *i64) -> i64 |
| 52 | func poly1305(key: *u8, msg: *u8, mlen: i64, tag: *u8) -> i64 |
| 117 | func pw(fd: i64, str: *u8) -> i64 { var n: i64 = 0; while str[n] != (0 as u8) { n = n + 1 } sys_write(fd, str, n); return 0 } |
| 118 | func pwn(fd: i64, v: i64) -> i64 |
| 127 | func pwhex(fd: i64, tag: *u8, n: i64) -> i64 |
| 138 | func emit(fd: i64, okA: i64, diff: i64, tag: *u8, ok: i64) -> i64 |
| 148 | func main() -> i64 |