// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
// SPDX-License-Identifier: GPL-3.0-or-later
-import blake2b from 'blake2b-wasm'
+import blake2b from 'blake2b'
import { nanoCKD } from './bip32-key-derivation.js'
let addEventListener = globalThis.addEventListener
const inputHex = `${seed}${indexHex}`.padStart(72, '0')
const inputArray = (inputHex.match(/.{1,2}/g) ?? []).map(h => parseInt(h, 16))
const inputBytes = Uint8Array.from(inputArray)
- const hash = blake2b().update(inputBytes).digest('hex')
+ const hash = blake2b(32).update(inputBytes).digest('hex')
return hash
}