Formatting nits
This commit is contained in:
@@ -106,7 +106,7 @@ static bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMateri
|
|||||||
CCrypter cKeyCrypter;
|
CCrypter cKeyCrypter;
|
||||||
std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
|
std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
|
||||||
memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
|
memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
|
||||||
if(!cKeyCrypter.SetKey(vMasterKey, chIV))
|
if (!cKeyCrypter.SetKey(vMasterKey, chIV))
|
||||||
return false;
|
return false;
|
||||||
return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext);
|
return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext);
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ static bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<u
|
|||||||
CCrypter cKeyCrypter;
|
CCrypter cKeyCrypter;
|
||||||
std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
|
std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
|
||||||
memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
|
memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
|
||||||
if(!cKeyCrypter.SetKey(vMasterKey, chIV))
|
if (!cKeyCrypter.SetKey(vMasterKey, chIV))
|
||||||
return false;
|
return false;
|
||||||
return cKeyCrypter.Decrypt(vchCiphertext, *((CKeyingMaterial*)&vchPlaintext));
|
return cKeyCrypter.Decrypt(vchCiphertext, *((CKeyingMaterial*)&vchPlaintext));
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ static bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<u
|
|||||||
static bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key)
|
static bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key)
|
||||||
{
|
{
|
||||||
CKeyingMaterial vchSecret;
|
CKeyingMaterial vchSecret;
|
||||||
if(!DecryptSecret(vMasterKey, vchCryptedSecret, vchPubKey.GetHash(), vchSecret))
|
if (!DecryptSecret(vMasterKey, vchCryptedSecret, vchPubKey.GetHash(), vchSecret))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (vchSecret.size() != 32)
|
if (vchSecret.size() != 32)
|
||||||
@@ -140,7 +140,7 @@ static bool DecryptSproutSpendingKey(const CKeyingMaterial& vMasterKey,
|
|||||||
libzcash::SproutSpendingKey& sk)
|
libzcash::SproutSpendingKey& sk)
|
||||||
{
|
{
|
||||||
CKeyingMaterial vchSecret;
|
CKeyingMaterial vchSecret;
|
||||||
if(!DecryptSecret(vMasterKey, vchCryptedSecret, address.GetHash(), vchSecret))
|
if (!DecryptSecret(vMasterKey, vchCryptedSecret, address.GetHash(), vchSecret))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (vchSecret.size() != libzcash::SerializedSproutSpendingKeySize)
|
if (vchSecret.size() != libzcash::SerializedSproutSpendingKeySize)
|
||||||
@@ -157,7 +157,7 @@ static bool DecryptSaplingSpendingKey(const CKeyingMaterial& vMasterKey,
|
|||||||
libzcash::SaplingSpendingKey& sk)
|
libzcash::SaplingSpendingKey& sk)
|
||||||
{
|
{
|
||||||
CKeyingMaterial vchSecret;
|
CKeyingMaterial vchSecret;
|
||||||
if(!DecryptSecret(vMasterKey, vchCryptedSecret, fvk.GetFingerprint(), vchSecret))
|
if (!DecryptSecret(vMasterKey, vchCryptedSecret, fvk.GetFingerprint(), vchSecret))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (vchSecret.size() != libzcash::SerializedSaplingSpendingKeySize)
|
if (vchSecret.size() != libzcash::SerializedSaplingSpendingKeySize)
|
||||||
|
|||||||
Reference in New Issue
Block a user