| 32 | } |
| 33 | |
| 34 | bool CCrypter::SetKey(const CKeyingMaterial& chNewKey, const vector<unsigned char>& chNewIV) { |
| 35 | if (chNewKey.size() != WALLET_CRYPTO_KEY_SIZE || chNewIV.size() != WALLET_CRYPTO_KEY_SIZE) |
| 36 | return false; |
| 37 | |
| 38 | memcpy(&chKey[0], &chNewKey[0], sizeof chKey); |
| 39 | memcpy(&chIV[0], &chNewIV[0], sizeof chIV); |
| 40 | |
| 41 | fKeySet = true; |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | bool CCrypter::Encrypt(const CKeyingMaterial& vchPlaintext, vector<unsigned char>& vchCiphertext) { |
| 46 | if (!fKeySet) |
no test coverage detected