nx_rsa_pss_sha256_gate.nx
buildroot/runtime/nx_rsa_pss_sha256_gate.nx
about
nx_rsa_pss_sha256_gate.nx -- KAT for rsa_pss_sha256_verify vs a REAL OpenSSL-3.2 RSA-PSS/SHA-256/salt32
signature (2048-bit key; "openssl dgst -sha256 -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:32 -sign";
self-verified "Verified OK"). T1 accept the genuine sig; T2/T3/T4 reject a 1-bit-flipped sig / wrong message /
flipped modulus (no false accept -- the possession-proof invariant). GREEN iff 4/4. expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_u2048.nxnx_rsa_pss_sha256.nxnx_gate_verdict.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
| 10 | func gw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 11 | func gn(v: i64) -> i64 { let b: *u8 = sys_mmap(24); var m: i64 = v; if m<0 { gw("-" as *u8); m=0-m } let t: *u8=sys_mmap(24); var k: i64=0; if m==0 {t[0]=48 as u8;k=1} while m>0 {t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k {b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 12 | func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("\n" as *u8); return ok } |
| 13 | func hx(c: i64) -> i64 { if c>=48 { if c<=57 { return c-48 } } if c>=97 { if c<=102 { return c-87 } } if c>=65 { if c<=70 { return c-55 } } return 0 } called by 1: h2b |
| 14 | func h2b(s: *u8, out: *u8) -> i64 { var i: i64=0; var o: i64=0; while s[i]!=(0 as u8) { if s[i+1]==(0 as u8) { i=i+1 } else { out[o]=((hx(s[i] as i64)<<4)|hx(s[i+1] as i64)) as u8; o=o+1; i=i+2 } } return o } |
| 16 | func main() -> i64 |