X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fjs%2Findex.js;h=5b8aedb1f866dbba395135ebc59276b9e3068343;hb=e66c8a9b5aade1c6b19c58e5366f777fde3f373f;hp=7f39ad2e737f39a8e735557fbe1af460a4f7a934;hpb=a19a549879504d12ec10955bc550c50294f996ec;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/src/js/index.js b/src/js/index.js index 7f39ad2..5b8aedb 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -164,8 +164,7 @@ function calcBip32Seed(phrase, passphrase, path) { var seed = mnemonic.toSeed(phrase, passphrase); - var seedHash = Bitcoin.crypto.sha256(seed).toString("hex"); - bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network); + bip32RootKey = Bitcoin.HDNode.fromSeedHex(seed, network); bip32ExtendedKey = bip32RootKey; // Derive the key from the path var pathBits = path.split("/"); @@ -200,6 +199,7 @@ function findPhraseErrors(phrase) { // TODO make this right // Preprocess the words + phrase = mnemonic.normalizeString(phrase); var parts = phrase.split(" "); var proper = []; for (var i=0; i