]> git.codecow.com Git - nano25519.git/commitdiff
Test bulk speed improvement with random inputs instead of repeated.
authorChris Duncan <chris@codecow.com>
Thu, 27 Aug 2026 14:44:15 +0000 (07:44 -0700)
committerChris Duncan <chris@codecow.com>
Thu, 27 Aug 2026 14:44:15 +0000 (07:44 -0700)
test/index.html

index 80a14d6ae159c5877dd8d16fa2de8beb354b5b97..87542cd85e3376d741b2c28a29416f3e6316b67b 100644 (file)
@@ -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}<br/>`
                                        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()