MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / DecryptMasterKey

Function DecryptMasterKey

src/wallet/wallet.cpp:602–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600}
601
602static bool DecryptMasterKey(const SecureString& wallet_passphrase, const CMasterKey& master_key, CKeyingMaterial& plain_master_key)
603{
604 CCrypter crypter;
605 if (!crypter.SetKeyFromPassphrase(wallet_passphrase, master_key.vchSalt, master_key.nDeriveIterations, master_key.nDerivationMethod)) {
606 return false;
607 }
608 if (!crypter.Decrypt(master_key.vchCryptedKey, plain_master_key)) {
609 return false;
610 }
611
612 return true;
613}
614
615bool CWallet::Unlock(const SecureString& strWalletPassphrase)
616{

Callers 2

UnlockMethod · 0.85

Calls 2

SetKeyFromPassphraseMethod · 0.80
DecryptMethod · 0.45

Tested by

no test coverage detected