15 const std::vector<unsigned char> &vchCryptedSecret)
31 static bool DecryptSaplingSpendingKey(
const CKeyingMaterial& vMasterKey,
32 const std::vector<unsigned char>& vchCryptedSecret,
59 const std::vector<unsigned char>& vchCryptedSecret = it->second;
60 return DecryptSaplingSpendingKey(
vMasterKey, vchCryptedSecret, it->first, skOut);
75 LogPrintf(
"%s: mapCryptedSaplingSpendingKeys empty. No need to unlock anything.\n", __func__);
84 const std::vector<unsigned char> &vchCryptedSecret = (*miSapling).second;
86 if (!DecryptSaplingSpendingKey(vMasterKeyIn, vchCryptedSecret, extfvk, sk)) {
91 if (fDecryptionThoroughlyChecked)
95 if (keyPass && keyFail) {
96 LogPrintf(
"Sapling wallet is probably corrupted: Some keys decrypt but not all.\n");
97 throw std::runtime_error(
"Error unlocking sapling wallet: some keys decrypt but not all. Your wallet file may be corrupt.");
99 if (keyFail || !keyPass)
bool HaveSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk) const
bool GetSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk, libzcash::SaplingExtendedSpendingKey &skOut) const
virtual bool AddSaplingFullViewingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk)
Support for Sapling full viewing keys.
CryptedSaplingSpendingKeyMap mapCryptedSaplingSpendingKeys
bool HaveSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk) const override
virtual bool AddCryptedSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk, const std::vector< unsigned char > &vchCryptedSecret)
Sapling.
bool UnlockSaplingKeys(const CKeyingMaterial &vMasterKeyIn, bool fDecryptionThoroughlyChecked)
bool GetSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk, libzcash::SaplingExtendedSpendingKey &skOut) const override
CKeyingMaterial vMasterKey
RecursiveMutex cs_KeyStore
SaplingFullViewingKey full_viewing_key() const
uint256 GetFingerprint() const
Get the fingerprint of this full viewing key (as defined in ZIP 32).
bool DecryptSecret(const CKeyingMaterial &vMasterKey, const std::vector< unsigned char > &vchCiphertext, const uint256 &nIV, CKeyingMaterial &vchPlaintext)
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
libzcash::SaplingFullViewingKey fvk
libzcash::SaplingExpandedSpendingKey expsk
const size_t ZIP32_XSK_SIZE