diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-05-01 06:52:05 +0200 |
---|---|---|
committer | Pieter Wuille <sipa@ulyssis.org> | 2013-05-30 05:20:21 +0200 |
commit | dfa23b94c24aae6466152fccbe896ba5dc0e97b4 (patch) | |
tree | a1f7f856577b2223bae9351c960b595b4032ce7a /src/crypter.cpp | |
parent | 5d891489ab7828ad8db15e85bb63e2f13f021a6a (diff) |
CSecret/CKey -> CKey/CPubKey split/refactor
Diffstat (limited to 'src/crypter.cpp')
-rw-r--r-- | src/crypter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crypter.cpp b/src/crypter.cpp index a2b62a87c8..32baabd674 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -100,17 +100,17 @@ bool CCrypter::Decrypt(const std::vector<unsigned char>& vchCiphertext, CKeyingM } -bool EncryptSecret(CKeyingMaterial& vMasterKey, const CSecret &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext) +bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext) { CCrypter cKeyCrypter; std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE); memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE); if(!cKeyCrypter.SetKey(vMasterKey, chIV)) return false; - return cKeyCrypter.Encrypt((CKeyingMaterial)vchPlaintext, vchCiphertext); + return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext); } -bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CSecret& vchPlaintext) +bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext) { CCrypter cKeyCrypter; std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE); |