| 119 | } |
| 120 | |
| 121 | static bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext) |
| 122 | { |
| 123 | CCrypter cKeyCrypter; |
| 124 | std::vector<unsigned char> chIV(WALLET_CRYPTO_IV_SIZE); |
| 125 | memcpy(chIV.data(), &nIV, WALLET_CRYPTO_IV_SIZE); |
| 126 | if(!cKeyCrypter.SetKey(vMasterKey, chIV)) |
| 127 | return false; |
| 128 | return cKeyCrypter.Decrypt(vchCiphertext, *((CKeyingMaterial*)&vchPlaintext)); |
| 129 | } |
| 130 | |
| 131 | static bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key) |
| 132 | { |
no test coverage detected