]> git.codecow.com Git - nano25519.git/commitdiff
Add positive test for identity signature verification. Fix failed verify rejection...
authorChris Duncan <chris@codecow.com>
Fri, 4 Sep 2026 21:35:08 +0000 (14:35 -0700)
committerChris Duncan <chris@codecow.com>
Fri, 4 Sep 2026 21:35:08 +0000 (14:35 -0700)
test/node.mjs

index 4dcf2e5f49215cf49b2e9dc0650bd92cbe45d3a9..f61693ab8de50f0a2eee476f6a978ae341e0872a 100644 (file)
@@ -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