mirror of
https://github.com/minibits-cash/minibits_wallet.git
synced 2026-08-11 00:47:42 +00:00
36 lines
1.6 KiB
Diff
36 lines
1.6 KiB
Diff
diff --git a/node_modules/@scure/bip39/package.json b/node_modules/@scure/bip39/package.json
|
|
index c30d78b..95af581 100644
|
|
--- a/node_modules/@scure/bip39/package.json
|
|
+++ b/node_modules/@scure/bip39/package.json
|
|
@@ -45,7 +45,7 @@
|
|
"fetch-wordlist": "./scripts/fetch-wordlist.js"
|
|
},
|
|
"sideEffects": false,
|
|
- "main": "index.js",
|
|
+ "main": "src/index.ts",
|
|
"types": "./index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
diff --git a/node_modules/@scure/bip39/src/index.ts b/node_modules/@scure/bip39/src/index.ts
|
|
index 5cd4255..6fba64b 100644
|
|
--- a/node_modules/@scure/bip39/src/index.ts
|
|
+++ b/node_modules/@scure/bip39/src/index.ts
|
|
@@ -5,6 +5,7 @@ import { sha256 } from '@noble/hashes/sha256';
|
|
import { sha512 } from '@noble/hashes/sha512';
|
|
import { randomBytes } from '@noble/hashes/utils';
|
|
import { utils as baseUtils } from '@scure/base';
|
|
+import QuickCrypto from 'react-native-quick-crypto'
|
|
|
|
// Japanese wordlist
|
|
const isJapanese = (wordlist: string[]) => wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093';
|
|
@@ -142,5 +143,8 @@ export function mnemonicToSeed(mnemonic: string, passphrase = '') {
|
|
* // new Uint8Array([...64 bytes])
|
|
*/
|
|
export function mnemonicToSeedSync(mnemonic: string, passphrase = '') {
|
|
- return pbkdf2(sha512, normalize(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 });
|
|
+ // const original = pbkdf2(sha512, normalize(mnemonic).nfkd, salt(passphrase), { c: 2048, dkLen: 64 });
|
|
+ const updated = new Uint8Array(QuickCrypto.pbkdf2Sync(normalize(mnemonic).nfkd, salt(passphrase), 2048, 64, 'sha512'));
|
|
+ // console.log('[@scure.bip39.mnemonicToSeedSync] Patched to use QuickCrypto.pbkdf2Sync')
|
|
+ return updated
|
|
}
|