|
@@ 36-38 (lines=3) @@
|
| 33 |
|
|
| 34 |
|
$bip39 = MnemonicFactory::bip39(); |
| 35 |
|
|
| 36 |
|
if (!($secret = CryptoJSAES::decrypt(base64_encode($bip39->mnemonicToEntropy($passwordEncryptedSecret)->getBinary()), $passphrase))) { |
| 37 |
|
throw new BlocktrailSDKException("Failed to decret password encrypted secret"); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
if (!($primarySeed = CryptoJSAES::decrypt(base64_encode($bip39->mnemonicToEntropy($encryptedPrimarySeed)->getBinary()), $secret))) { |
| 41 |
|
throw new BlocktrailSDKException("failed to decrypt encrypted primary seed! (weird!)"); |
|
@@ 40-42 (lines=3) @@
|
| 37 |
|
throw new BlocktrailSDKException("Failed to decret password encrypted secret"); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
if (!($primarySeed = CryptoJSAES::decrypt(base64_encode($bip39->mnemonicToEntropy($encryptedPrimarySeed)->getBinary()), $secret))) { |
| 41 |
|
throw new BlocktrailSDKException("failed to decrypt encrypted primary seed! (weird!)"); |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
$backupSeed = $bip39->mnemonicToEntropy($backupSeed); |
| 45 |
|
|