From f1a88dad2c0c8772fc4c4e5bc3ddaaf7565845ac Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 15 May 2026 01:17:00 -0700 Subject: [PATCH] Change child key to async since HMAC is anyway. --- src/lib/crypto/bip44.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/crypto/bip44.ts b/src/lib/crypto/bip44.ts index 929badc..bdb7fb7 100644 --- a/src/lib/crypto/bip44.ts +++ b/src/lib/crypto/bip44.ts @@ -106,11 +106,11 @@ function CKDpriv (curve: Curve, { privateKey, chainCode }: ExtendedKey, index?: .then(I => childKey(curve, pk, I)) } -function childKey (curve: Curve, pk: Bytes, I: ArrayBuffer): ExtendedKey { +function childKey (curve: Curve, pk: Bytes, I: ArrayBuffer): Promise { const IL = I.slice(0, I.byteLength / 2) const IR = I.slice(I.byteLength / 2) if (curve === 'ed25519 seed') { - return ({ privateKey: IL, chainCode: IR }) + return Promise.resolve({ privateKey: IL, chainCode: IR }) } const ILparsed = parse256(new Uint8Array(IL)) if (ILparsed >= Point.CURVE().n) { @@ -121,7 +121,7 @@ function childKey (curve: Curve, pk: Bytes, I: ArrayBuffer): ExtendedKey { if (ck === 0n) { throw new Error('Invalid child key is zero') } - return ({ privateKey: ser256(ck).buffer, chainCode: IR }) + return Promise.resolve({ privateKey: ser256(ck).buffer, chainCode: IR }) } function ser32 (integer: number): Bytes { -- 2.47.3