code wiki / _hdl_build / nx_voprf_rfc_kat.nx
nx_voprf_rfc_kat.nx
buildroot/runtime/_hdl_build/nx_voprf_rfc_kat.nx
about
nx_voprf_rfc_kat.nx -- ENGINEER verification of the OPAQUE building block (the auth crown jewel's
foundation). nx_voprf.nx (RFC 9497 OPRF P-256/SHA-256, Base mode) shipped WITHOUT a test = the whole
modern-auth charter rested on UNVERIFIED crypto. This gates it against the RFC's OWN authoritative
test vector (Appendix A.3.1.1).
KEY INSIGHT: the OPRF output is BLIND-INDEPENDENT -- F(skS, input) is fixed regardless of the random
blind. So even though nx_voprf_blind draws its own CSPRNG blind (we cannot inject the RFC's fixed
blind), the FULL round trip Blind->BlindEvaluate->Finalize must reproduce the RFC's Output EXACTLY.
That single assert validates hash-to-curve (RFC 9380), P-256 scalar-mult, the blind/unblind modular
inverse, and the Finalize hash -- the entire stack -- against the real standard.
RFC 9497 A.3.1.1 (OPRF(P-256, SHA-256), Base mode):
skSm = 159749d750713afe245d2d39ccfaae8381c53ce92d098a9375ee70739c7ac0bf
Input = 00
Output = a0b34de5fa4c5b6da07e72af73cc507cceeb48981b97b7285fc375345fe495dd
(we use our own random Blind; the Output is invariant, so this is a true KAT.)
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_voprf.nxnx_voprf_finalize.nxnx_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
| none |
functions
| 22 | func vk_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 25 | func vk_nib(c: i64) -> i64 called by 1: vk_hex |
| 32 | func vk_hex(hexs: *u8, out: *u8) -> i64 |
| 42 | func vk_hexdump(label: *u8, b: *u8) -> i64 |
| 56 | func vk_eq32(a: *u8, b: *u8) -> i64 called by 1: main |
| 63 | func vk_oprf(skS: *u8, input: *u8, in_n: i64, out32: *u8) -> i64 |
| 73 | func main() -> i64 |