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 tooltopic 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)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap vk_hex vk_nib vk_oprf sys_mmap ↻ nx_voprf_blind nx_voprf_random_scalar u256_alloc nx_scratch nx_scratch_init nx_scratch_oom sys_mmap ↻ p256_modn_load_n nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close u256_load_be u256_is_zero u256_cmp sys_mmap ↻ _voprf_load_dst_h2c sys_mmap ↻ _voprf_load_context_string p256_point_alloc nx_scratch ↻ u256_alloc ↻ p256_field_one u256_one u256_zero p256_field_zero u256_zero ↻ nx_h2c_hash_to_curve_p256 sys_mmap ↻ nx_h2c_hash_to_field_p256 sys_mmap ↻ nx_h2c_expand_message_xmd_

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 }
called by 2: vk_hexdumpmain calls 1: sys_write
25func vk_nib(c: i64) -> i64
called by 1: vk_hex
32func vk_hex(hexs: *u8, out: *u8) -> i64
called by 1: main calls 1: vk_nib
42func vk_hexdump(label: *u8, b: *u8) -> i64
called by 1: main calls 3: vk_wsys_mmapsys_write
56func vk_eq32(a: *u8, b: *u8) -> i64
called by 1: main
63func vk_oprf(skS: *u8, input: *u8, in_n: i64, out32: *u8) -> i64
73func main() -> i64