Skip to content

Commit

Permalink
fix: react native's bip32 should use array instead of buffer due to i…
Browse files Browse the repository at this point in the history
…ncompatibility (#2502)

Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: ivaylogarnev-limechain <[email protected]>
  • Loading branch information
ivaylonikolov7 authored and ivaylogarnev-limechain committed Sep 19, 2024
1 parent 0ea5981 commit 0b3d708
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/cryptography/src/primitive/bip32.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export async function derive(parentKey, chainCode, index) {
.getPrivate()
.add(secp256k1.keyFromPrivate(IL).getPrivate())
.mod(N);
const hexZeroPadded = hex.hexZeroPadded(ki.toBuffer(), 32);
const hexZeroPadded = hex.hexZeroPadded(
Uint8Array.from(ki.toArray()),
32,
);
// const ki = Buffer.from(ecc.privateAdd(this.privateKey!, IL)!);

// In case ki == 0, proceed with the next value for i
Expand Down

0 comments on commit 0b3d708

Please sign in to comment.