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 <ivaylo.nikolov@limechain.tech>
  • Loading branch information
ivaylonikolov7 committed Sep 10, 2024
1 parent 0ead418 commit 3f2238f
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 3f2238f

Please sign in to comment.