Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/wallet_crypto_tests.cpp
Show All 24 Lines | bool OldSetKeyFromPassphrase(const SecureString &strKeyData, | ||||
int i = 0; | int i = 0; | ||||
if (nDerivationMethod == 0) | if (nDerivationMethod == 0) | ||||
i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha512(), &chSalt[0], | i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha512(), &chSalt[0], | ||||
(uint8_t *)&strKeyData[0], strKeyData.size(), | (uint8_t *)&strKeyData[0], strKeyData.size(), | ||||
nRounds, chKey, chIV); | nRounds, chKey, chIV); | ||||
if (i != (int)WALLET_CRYPTO_KEY_SIZE) { | if (i != (int)WALLET_CRYPTO_KEY_SIZE) { | ||||
memory_cleanse(chKey, sizeof(chKey)); | memory_cleanse(chKey, WALLET_CRYPTO_KEY_SIZE); | ||||
memory_cleanse(chIV, sizeof(chIV)); | memory_cleanse(chIV, WALLET_CRYPTO_IV_SIZE); | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool OldEncrypt(const CKeyingMaterial &vchPlaintext, | bool OldEncrypt(const CKeyingMaterial &vchPlaintext, | ||||
std::vector<uint8_t> &vchCiphertext, const uint8_t chKey[32], | std::vector<uint8_t> &vchCiphertext, const uint8_t chKey[32], | ||||
const uint8_t chIV[16]) { | const uint8_t chIV[16]) { | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |