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