]> git.codecow.com Git - nano25519.git/commitdiff
Create WASM module directly from imported bytes. Fix error imports.
authorChris Duncan <chris@codecow.com>
Thu, 15 Oct 2026 17:38:54 +0000 (10:38 -0700)
committerChris Duncan <chris@codecow.com>
Thu, 15 Oct 2026 17:38:54 +0000 (10:38 -0700)
src/lib/wasm.ts

index c0a753891808c9f4c537af231c2511875ad4f415..b09cfddc02f01f1e8d560e2cfc69650e870d0621 100644 (file)
@@ -3,8 +3,8 @@
 
 //@ts-expect-error
 import nano25519_wasm from '../../build/nano25519.wasm'
-import { abort, errorCodes, } from './errors'
-import { Bytes, Nano25519MutexError, Nano25519TypeError, Words, byteLength, copy, isLE, objectFreeze, words, } from './primordials'
+import { abort, errorCodes, Nano25519MutexError, Nano25519TypeError, } from './errors'
+import { Bytes, Words, byteLength, isLE, objectFreeze, words, } from './primordials'
 
 type Exports = WebAssembly.Instance['exports'] & {
        clearMemory: () => void
@@ -66,8 +66,7 @@ export const Mutex = {
        }
 }
 
-const wasm = copy(nano25519_wasm)
-const module = new WebAssembly.Module(wasm)
+const module = new WebAssembly.Module(nano25519_wasm)
 const instance = new WebAssembly.Instance(module, { env: { abort } })
 const exports = instance.exports as Exports