From: Chris Duncan Date: Tue, 25 Aug 2026 18:49:03 +0000 (-0700) Subject: Update nano25519 sign test to properly pass private and public keys separately. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=2418872e1cd03e8604225516d92f715c3da19aa7;p=nano25519.git Update nano25519 sign test to properly pass private and public keys separately. --- diff --git a/test/index.html b/test/index.html index 9e5c513..7ece983 100644 --- a/test/index.html +++ b/test/index.html @@ -152,9 +152,11 @@ SPDX-License-Identifier: GPL-3.0-or-later const sign = (h, sk, pk, api) => { const h8 = new Uint8Array(h.match(/.{2}/g).map(b => parseInt(b, 16))) const sk8 = new Uint8Array((sk + pk).match(/.{2}/g).map(b => parseInt(b, 16))) + const prv8 = new Uint8Array(sk.match(/.{2}/g).map(b => parseInt(b, 16))) + const pub8 = new Uint8Array(pk.match(/.{2}/g).map(b => parseInt(b, 16))) switch (api) { case 'nano25519': { - const s8 = nano25519.sign(h8, sk8) + const s8 = nano25519.sign(h8, prv8, pub8) return [...s8].map(b => b.toString(16).padStart(2, '0')).join('') } case 'NanocurrencyWeb': { @@ -215,7 +217,7 @@ SPDX-License-Identifier: GPL-3.0-or-later return end - start } - export function test(api, size, runs) { + export async function test(api, size, runs) { if (typeof size !== 'number' || size < 1) { size = 1 }