]> zoso.dev Git - libnemo.git/commitdiff
Fix BLAKE2b ckd using 16-bit index instead of 32-bit.
authorChris Duncan <chris@zoso.dev>
Sun, 10 Nov 2024 21:25:59 +0000 (13:25 -0800)
committerChris Duncan <chris@zoso.dev>
Sun, 10 Nov 2024 21:25:59 +0000 (13:25 -0800)
src/lib/wallet.ts

index 08bb55a940f6bfe7f92309b3ebf53aa2f37396ea..08ada18e321008014177e877af0c0e74344e3b90 100644 (file)
@@ -546,7 +546,7 @@ export class Blake2bWallet extends Wallet {
        * @returns {Promise<Account>}\r
        */\r
        async ckd (index: number): Promise<Account> {\r
-               const hash = await Tools.blake2b([this.seed, dec.toHex(index, 4)])\r
+               const hash = await Tools.blake2b([this.seed, dec.toHex(index, 8)])\r
                const key = bytes.toHex(hash)\r
                return await Account.fromPrivateKey(key, index)\r
                // return await ckdPool.work({ type: 'blake2b', seed: this.seed, index })\r