From 58ddab8ce93f10e63dfb976177f81cdb52439ebf Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 19 Nov 2024 16:40:50 -0800 Subject: [PATCH] Switch to blake2b package from blake2b-wasm for ckd worker. --- src/lib/ckd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ckd.ts b/src/lib/ckd.ts index c0548e0..0e921ae 100644 --- a/src/lib/ckd.ts +++ b/src/lib/ckd.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2024 Chris Duncan // 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 @@ -55,6 +55,6 @@ async function ckdBlake2b (seed: string, index: number): Promise { 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 } -- 2.34.1