nx_ed25519_sign_bisect_test.nx
buildroot/runtime/nx_ed25519_sign_bisect_test.nx
about
nx_ed25519_sign_bisect_test.nx -- bisection diagnostic for the
known Ed25519 sign byte-1 mismatch reported by
nx_ed25519_signature_smoke (FAIL at assertion #1).
Walks the RFC 8032 ยง7.1 test vector 1 (empty message) step by
step and returns a non-zero exit code at the FIRST step whose
output diverges from the published reference. This identifies
which Ed25519 sub-primitive is broken so the fix can target
the actual root cause instead of the symptom.
Step-by-step check sequence (each step returns its own assertion
code so the failure surface is unambiguous):
Step 1 (assertion 1..32): H = SHA-512(priv) byte-by-byte vs the
RFC 8032 reference H_priv (precomputed offline -- the SHA-512
of the known priv is itself a known value)
Step 2 (assertion 100): s_scalar = H[0..32] clamped == expected
s_scalar (precomputed offline)
Step 3 (assertion 200+i): A = s_scalar * G; compress(A) ==
known pub byte-by-byte (this catches scalar_mul OR compress
bugs)
Step 4 (assertion 300): if A_enc matches pub then scalar_mul
works for this scalar -- so any R_enc mismatch is sc_reduce's
fault. Continue.
Step 5 (assertion 400): r_h = SHA-512(prefix || empty) ==
expected (precomputed offline)
Step 6 (assertion 500+i): r_scalar = sc_reduce(r_h) bytes match
expected r_scalar (precomputed offline)
Step 7 (assertion 600+i): R = r_scalar * G; compress(R) matches
expected R_enc (= first 32 bytes of expected sig)
expect_exit: 0
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_ed25519.nxnx_ed25519_signature.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
| 40 | func _load_priv(priv: *u8) -> i64 called by 1: main |
| 53 | func _load_pub(pub: *u8) -> i64 called by 1: main |
| 78 | func _bytes_eq(a: *u8, b: *u8, n: i64) -> i64 called by 1: main |
| 88 | func _load_expected_sig_first32(out: *u8) -> i64 called by 1: main |
| 105 | func _load_basepoint_compressed(out: *u8) -> i64 called by 1: main |
| 113 | func _hexdump_label(label0: i64, label1: i64, buf: *u8, n: i64) -> i64 |
| 131 | func main() -> i64 |