Skip to content

Commit

Permalink
Update bip to use js version of pbkdf2 even more specific use case (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepimenta authored Aug 17, 2020
1 parent 44b4d47 commit 86d7ed7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/bip39+2.6.0.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/bip39/index.js b/node_modules/bip39/index.js
index efed68c..5630380 100644
index efed68c..d487227 100644
--- a/node_modules/bip39/index.js
+++ b/node_modules/bip39/index.js
@@ -4,6 +4,8 @@ var _pbkdf2 = require('pbkdf2')
Expand All @@ -22,7 +22,7 @@ index efed68c..5630380 100644
-
- return pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512')
+ // For chrome environments use the javascript version of pbkdf2
+ if (!!global.__REMOTEDEV__ || (global.location && global.location.pathname.includes('/debugger-ui')))
+ if (__DEV__ && (!!global.__REMOTEDEV__ || (global.location && global.location.pathname.includes('/debugger-ui'))))
+ return pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512')
+ const seed = Aes.pbkdf2Sync(mnemonicBuffer.toString('utf8'), saltBuffer.toString('utf8'), 2048, 512);
+ const seedBuffer = global.Buffer.from(seed, "hex")
Expand Down

0 comments on commit 86d7ed7

Please sign in to comment.