setInput('msg', message)
setInput('prv', privateKey)
setInput('pub', publicKey)
- wasm_sign(message.byteLength)
+ wasm_sign(byteLength(message))
for (let i = 0; i < SIGNATURE_BYTELENGTH; i++) {
signature[i] = getOutput('sign', i)
}
//! SPDX-FileCopyrightText: 2026 Chris Duncan <chris@codecow.com>
//! SPDX-License-Identifier: GPL-3.0-or-later
-import { isArray, normalize } from './primordials'
+import { byteLength, isArray, normalize } from './primordials'
import { Mutex, clearMemory, constants, getOutput, setInput, verify as wasm_verify, verify_blocks as wasm_verify_blocks, } from './wasm'
const { BLOCKHASH_BYTELENGTH, KEY_BYTELENGTH, MAX_MESSAGE_BYTELENGTH, MAX_VERIFY_BLOCKS, SIGNATURE_BYTELENGTH, } = constants
setInput('msg', message)
setInput('pub', publicKey)
setInput('sig', signature)
- wasm_verify(message.byteLength)
+ wasm_verify(byteLength(message))
const verified = getOutput('verify', 0)
return verified === 1
} finally {