crypter: add a BytesToKey clone to replace the use of openssl

BytesToKeySHA512AES should be functionally identical to EVP_BytesToKey, but
drops the dependency on openssl.
This commit is contained in:
Cory Fields
2015-03-20 01:24:12 -04:00
committed by lateminer
parent f48a300f74
commit df2b01b7cd
2 changed files with 31 additions and 4 deletions

View File

@@ -75,6 +75,8 @@ private:
unsigned char chIV[WALLET_CRYPTO_IV_SIZE];
bool fKeySet;
int BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, unsigned char *key,unsigned char *iv) const;
public:
bool SetKeyFromPassphrase(const SecureString &strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod);
bool Encrypt(const CKeyingMaterial& vchPlaintext, std::vector<unsigned char> &vchCiphertext);