From 7e1e37b0fa95f023c502226aff3e5091be97f559 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 30 Nov 2025 00:44:00 -0800 Subject: [PATCH] Fix bit shifting and remove redundant promise return. --- src/lib/crypto/bip44.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/crypto/bip44.ts b/src/lib/crypto/bip44.ts index 3e25626..cbb9114 100644 --- a/src/lib/crypto/bip44.ts +++ b/src/lib/crypto/bip44.ts @@ -120,7 +120,8 @@ export class Bip44 { static ser256 (integer: bigint): Uint8Array { let bytes = new Uint8Array(32) for (let i = bytes.byteLength - 1; i >= 0; i--) { - bytes[i] = Number((integer >> BigInt(i * 8)) & 0xffn) + bytes[i] = Number(integer & 0xffn) + integer >>= 8n } return bytes } @@ -137,9 +138,6 @@ export class Bip44 { return crypto.subtle.importKey('raw', key, { name: 'HMAC', hash: 'SHA-512' }, false, ['sign']) .then(pk => { return crypto.subtle.sign('HMAC', pk, data) - .then(signature => { - return signature - }) }) } } -- 2.47.3