From: Chris Duncan Date: Fri, 4 Sep 2026 21:35:08 +0000 (-0700) Subject: Add positive test for identity signature verification. Fix failed verify rejection... X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=941289594b6381c8ab09dff6c74e041295652911;p=nano25519.git Add positive test for identity signature verification. Fix failed verify rejection output. --- 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