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