55 nDeriveIterations = 25000;
56 nDerivationMethod = 0;
57 vchOtherDerivationParameters = std::vector<unsigned char>(0);
61 typedef std::vector<unsigned char, secure_allocator<unsigned char> >
CKeyingMaterial;
72 bool SetKeyFromPassphrase(
const SecureString &strKeyData,
const std::vector<unsigned char>& chSalt,
const unsigned int nRounds,
const unsigned int nDerivationMethod);
73 bool Encrypt(
const CKeyingMaterial& vchPlaintext, std::vector<unsigned char> &vchCiphertext);
74 bool Decrypt(
const std::vector<unsigned char>& vchCiphertext, CKeyingMaterial& vchPlaintext);
75 bool SetKey(
const CKeyingMaterial& chNewKey,
const std::vector<unsigned char>& chNewIV);
79 OPENSSL_cleanse(chKey,
sizeof(chKey));
80 OPENSSL_cleanse(chIV,
sizeof(chIV));
104 bool EncryptSecret(
const CKeyingMaterial& vMasterKey,
const CKeyingMaterial &vchPlaintext,
const uint256& nIV, std::vector<unsigned char> &vchCiphertext);
105 bool DecryptSecret(
const CKeyingMaterial& vMasterKey,
const std::vector<unsigned char>& vchCiphertext,
const uint256& nIV, CKeyingMaterial& vchPlaintext);
bool SetKeyFromPassphrase(const SecureString &strKeyData, const std::vector< unsigned char > &chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)
unsigned int nDerivationMethod
bool Encrypt(const CKeyingMaterial &vchPlaintext, std::vector< unsigned char > &vchCiphertext)
const unsigned int WALLET_CRYPTO_KEY_SIZE
static LockedPageManager instance
void LockRange(void *p, size_t size)
unsigned char chIV[WALLET_CRYPTO_KEY_SIZE]
bool SetKey(const CKeyingMaterial &chNewKey, const std::vector< unsigned char > &chNewIV)
Encryption/decryption context with key information.
std::vector< unsigned char > vchCryptedKey
Master key for wallet encryption.
std::vector< unsigned char > vchOtherDerivationParameters
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
bool DecryptSecret(const CKeyingMaterial &vMasterKey, const std::vector< unsigned char > &vchCiphertext, const uint256 &nIV, CKeyingMaterial &vchPlaintext)
IMPLEMENT_SERIALIZE(READWRITE(vchCryptedKey);READWRITE(vchSalt);READWRITE(nDerivationMethod);READWRITE(nDeriveIterations);READWRITE(vchOtherDerivationParameters);) CMasterKey()
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
bool Decrypt(const std::vector< unsigned char > &vchCiphertext, CKeyingMaterial &vchPlaintext)
unsigned char chKey[WALLET_CRYPTO_KEY_SIZE]
const unsigned int WALLET_CRYPTO_SALT_SIZE
void UnlockRange(void *p, size_t size)
std::vector< unsigned char > vchSalt
bool EncryptSecret(const CKeyingMaterial &vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256 &nIV, std::vector< unsigned char > &vchCiphertext)
unsigned int nDeriveIterations