diff options
| author | Jeff Garzik <[email protected]> | 2013-05-30 07:55:25 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2013-05-30 07:55:25 -0700 |
| commit | e2f42142a03fa817a7fe6529fc1d55ef2d016352 (patch) | |
| tree | a298361e95260b418a2bf82665390441e954954e /src/crypter.cpp | |
| parent | Merge pull request #2693 from jgarzik/checkpoint-bool (diff) | |
| parent | Make signature cache store CPubKeys (diff) | |
| download | discoin-e2f42142a03fa817a7fe6529fc1d55ef2d016352.tar.xz discoin-e2f42142a03fa817a7fe6529fc1d55ef2d016352.zip | |
Merge pull request #2600 from sipa/keyrefactor
Refactor key.cpp/.h
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 a2b62a87c..32baabd67 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); |