code wiki / _hdl_build / nx_voprf_rfc_kat.nx

nx_voprf_rfc_kat.nx

buildroot/runtime/_hdl_build/nx_voprf_rfc_kat.nx

4603 B105 linesdepth 11pulls 20 transitivereach 0 importersview sourcekind orphan librarytopic voprf
docsdependenciesstructsconstsfunctions

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

nx_voprf.nx nx_voprf_finalize.nx nx_syscalls.nx nx_voprf_rfc_kat.nx

imports: nx_voprf.nxnx_voprf_finalize.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

22func 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 }
25func vk_nib(c: i64) -> i64
32func vk_hex(hexs: *u8, out: *u8) -> i64
42func vk_hexdump(label: *u8, b: *u8) -> i64
56func vk_eq32(a: *u8, b: *u8) -> i64
63func vk_oprf(skS: *u8, input: *u8, in_n: i64, out32: *u8) -> i64
73func main() -> i64