From 941289594b6381c8ab09dff6c74e041295652911 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 4 Sep 2026 14:35:08 -0700 Subject: [PATCH] Add positive test for identity signature verification. Fix failed verify rejection output. --- test/node.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/node.mjs b/test/node.mjs index 4dcf2e5..f61693a 100644 --- a/test/node.mjs +++ b/test/node.mjs @@ -189,6 +189,13 @@ check(`verify_blocks relaxed check passes problematic signature string ${PROBLEM passes += +test failures += +!test +// Check identity signature verifies +result = verify(IDENTITY.signatureBytes, new Uint8Array(32), IDENTITY.publicKeyBytes) +test = result === true +check(`verify identity signature bytes ${IDENTITY.signature}`, test) +passes += +test +failures += +!test + // identity A and S=0 pin check_r so only R moves; any other A hides equalbytes bugs const forgery = IDENTITY.signatureBytes.slice() const accepted = [] @@ -203,7 +210,7 @@ for (let i = 0; i < constants.KEY_BYTELENGTH; i++) { } } test = accepted.length === 0 -check(`verify_blocks rejects R xor mask${test ? '' : ` (failed to reject ${accepted})`}`, test) +check(`verify_blocks rejects R xor mask${test ? '' : ` (failed to reject ${JSON.stringify(accepted)})`}`, test) passes += +test failures += +!test -- 2.52.0