From 721b72848c5456c14a3cfa23a188557e85ee6f19 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Thu, 25 Sep 2014 09:27:25 +1000 Subject: Support for optional passphrase in offline page --- bip39-standalone.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'bip39-standalone.html') diff --git a/bip39-standalone.html b/bip39-standalone.html index 0bb89f5..2948ed2 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html @@ -73,6 +73,12 @@ +
+ +
+ +
+
@@ -22775,6 +22781,7 @@ WORDLISTS = { var DOM = {}; DOM.phrase = $(".phrase"); + DOM.passphrase = $(".passphrase"); DOM.generate = $(".generate"); DOM.rootKey = $(".root-key"); DOM.extendedPrivKey = $(".extended-priv-key"); @@ -22800,6 +22807,7 @@ WORDLISTS = { function init() { // Events DOM.phrase.on("keyup", delayedPhraseChanged); + DOM.passphrase.on("keyup", delayedPhraseChanged); DOM.generate.on("click", generateClicked); DOM.more.on("click", showMore); DOM.bip32path.on("keyup", bip32Changed); @@ -22832,6 +22840,7 @@ WORDLISTS = { hideValidationError(); // Get the mnemonic phrase var phrase = DOM.phrase.val(); + var passphrase = DOM.passphrase.val(); var errorText = findPhraseErrors(phrase); if (errorText) { showValidationError(errorText); @@ -22844,7 +22853,7 @@ WORDLISTS = { return; } // Calculate and display - calcBip32Seed(phrase, derivationPath); + calcBip32Seed(phrase, passphrase, derivationPath); displayBip32Info(); hidePending(); } @@ -22924,8 +22933,8 @@ WORDLISTS = { return words; } - function calcBip32Seed(phrase, path) { - var seed = mnemonic.toSeed(phrase); + 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); bip32ExtendedKey = bip32RootKey; -- cgit v1.2.3