]> git.codecow.com Git - nano25519.git/commitdiff
Only toggle test size when switching to or from bulk. Fix typo.
authorChris Duncan <chris@codecow.com>
Tue, 6 Oct 2026 21:23:33 +0000 (14:23 -0700)
committerChris Duncan <chris@codecow.com>
Tue, 6 Oct 2026 21:23:33 +0000 (14:23 -0700)
README.md
test/index.html

index 5a02abfaa5fd582cee2f1b7f88c36316837bef4e..fe8cdc02b0c4739da0f31f8f0b3db05265c3c46c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -198,7 +198,7 @@ optimized to take advantage of SIMD parallelism using WebAssembly vector types.
 
 ## Tests
 
-A few basic tests are availabe in the source repository under `test/`.
+A few basic tests are available in the source repository under `test/`.
 
 - `index.html` is a web interface to test browser execution and compare
   performance with other browser-based implementations.
index a95eb6e118929a4e7be782233d42a0683bf1331a..bf0f33dbb1c905288ca9a5aff7c458607b3d9fd8 100644 (file)
@@ -497,12 +497,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
                        const size = document.getElementById('size')
                        const api = document.getElementById('api')?.value
                        if (api === 'nano25519 with bulk block verification') {
-                               bytes.value = nano25519.constants.BLOCKHASH_BYTELENGTH
-                               bytes.disabled = true
-                               size.value = nano25519.constants.MAX_VERIFY_BLOCKS
-                               size.dataset.value = 1
-                               size.disabled = true
-                       } else {
+                               if (!size.disabled) {
+                                       bytes.value = nano25519.constants.BLOCKHASH_BYTELENGTH
+                                       bytes.disabled = true
+                                       size.value = nano25519.constants.MAX_VERIFY_BLOCKS
+                                       size.dataset.value = 1
+                                       size.disabled = true
+                               }
+                       } else if (size.disabled) {
                                bytes.disabled = false
                                size.value = 100
                                size.dataset.value = 0
@@ -542,11 +544,44 @@ SPDX-License-Identifier: GPL-3.0-or-later
                document.getElementById('btnStartTest').addEventListener('click', startTest)
        </script>
        <style>
-               body{background:black;color:white;font-size:0.9rem;line-height:140%;margin:0 auto;max-width:900px;}a{color:darkcyan;}input[type=number]{width:5em;}input[type=checkbox]{margin-right:2em;}
-               div.hex{display:inline-block;font-family:monospace;}
-               div.hex::before{color:grey;content:'0x';display:inline-block;font-family:monospace;font-size:90%;left:0.5em;position:relative;width:0;}
-               div.hex>input{font-family:monospace;padding-left:1.5em;}
-               .warning::before{content:'⚠️';}
+               body {
+                       background: black;
+                       color: white;
+                       font-size: 0.9rem;
+                       line-height: 140%;
+                       margin: 0 auto;
+                       max-width: 900px;
+               }
+               a {
+                       color: darkcyan;
+               }
+               input[type=number] {
+                       width: 5em;
+               }
+               input[type=checkbox] {
+                       margin-right: 2em;
+               }
+               div.hex {
+                       display: inline-block;
+                       font-family: monospace;
+               }
+               div.hex::before {
+                       color: grey;
+                       content: '0x';
+                       display: inline-block;
+                       font-family: monospace;
+                       font-size: 90%;
+                       left: 0.5em;
+                       position: relative;
+                       width: 0;
+               }
+               div.hex > input {
+                       font-family: monospace;
+                       padding-left: 1.5em;
+               }
+               .warning::before {
+                       content: '⚠️';
+               }
        </style>
 </head>