]> git.codecow.com Git - nano25519.git/commitdiff
Log more helpful info on wasm error.
authorChris Duncan <chris@zoso.dev>
Sun, 16 Aug 2026 05:47:59 +0000 (22:47 -0700)
committerChris Duncan <chris@zoso.dev>
Sun, 16 Aug 2026 05:47:59 +0000 (22:47 -0700)
src/assembly/index.ts
src/lib/nano25519.ts

index be6705eb778c644bb9862ab3e65f2505d6d0553a..5d2a4a17729abdadb63f2f13b37f683c797e328b 100644 (file)
@@ -195,7 +195,7 @@ const verify_k = new StaticArray<u8>(PUBLICKEY_BYTES)
  * @param {u64} k - 32-byte public key\r
  */\r
 export function verify (mlen: i32): void {\r
-       if (mlen < 0 || mlen > 32768) throw new Error()\r
+       if (mlen < 0 || mlen > 32768) throw new Error('invalid message length')\r
        const s = verify_s\r
        const m = MESSAGE_BUFFER\r
        const k = verify_k\r
index 2f402b294113c96cdc3a8387ceeb1b2573a90db9..115d90dc89f2105a93b258e0d1bd3fe38f2a09cd 100644 (file)
@@ -37,8 +37,7 @@ export const nano25519_init = (bytes: number[]): { derive: typeof derive, sign:
                                file >>>= 0
                                row >>>= 0
                                col >>>= 0
-                               const message = 'nano25519/async wasm abort'
-                               console.error(message, getString(msg), getString(file), { msg, file, row, col })
+                               const message = `Nano25519WasmError: ${getString(msg)}, ${getString(file)}, row ${row}, col ${col}`
                                throw new Error(message)
                        },
                        "performance.now" () {