From: Chris Duncan Date: Thu, 27 Aug 2026 14:44:15 +0000 (-0700) Subject: Test bulk speed improvement with random inputs instead of repeated. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=166b683ec4cb0fd3baf04307d9c5636b8099ed40;p=nano25519.git Test bulk speed improvement with random inputs instead of repeated. --- diff --git a/test/index.html b/test/index.html index 80a14d6..87542cd 100644 --- a/test/index.html +++ b/test/index.html @@ -374,15 +374,15 @@ SPDX-License-Identifier: GPL-3.0-or-later document.getElementById('status').innerHTML = `TESTING IN PROGRESS. THIS MAY TAKE A LONG TIME. ${i}/${runs} ${j}/${size}
` let start, end, duration, blockhash, privateKey, publicKey, signature start = end = duration = 0 - blockHash = random() privateKey = random() try { if (api === 'nano25519 with bulk block verification') { publicKey = derive(privateKey, 'nano25519') - signature = sign(blockHash, privateKey, publicKey, 'nano25519') const blocks = [] for (let i = 0; i < 341; i++) { + blockHash = random() + signature = sign(blockHash, privateKey, publicKey, 'nano25519') blocks[i] = { hash: blockHash, signature } } start = performance.now() @@ -396,6 +396,8 @@ SPDX-License-Identifier: GPL-3.0-or-later signTimes[i].push(0) verifyTimes[i].push(duration) } else { + blockHash = random() + start = performance.now() publicKey = derive(privateKey, api) end = performance.now()