From: Chris Duncan Date: Sun, 10 Nov 2024 21:25:59 +0000 (-0800) Subject: Fix BLAKE2b ckd using 16-bit index instead of 32-bit. X-Git-Tag: v0.0.20~29 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=d9cc1833c9a2292169447697ed00cb2f03f1b347;p=libnemo.git Fix BLAKE2b ckd using 16-bit index instead of 32-bit. --- diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index 08bb55a..08ada18 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -546,7 +546,7 @@ export class Blake2bWallet extends Wallet { * @returns {Promise} */ async ckd (index: number): Promise { - const hash = await Tools.blake2b([this.seed, dec.toHex(index, 4)]) + const hash = await Tools.blake2b([this.seed, dec.toHex(index, 8)]) const key = bytes.toHex(hash) return await Account.fromPrivateKey(key, index) // return await ckdPool.work({ type: 'blake2b', seed: this.seed, index })