Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Encryption/decryption context with key information. More...
#include <crypter.h>
Public Member Functions | |
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) const |
bool | Decrypt (const std::vector< unsigned char > &vchCiphertext, CKeyingMaterial &vchPlaintext) const |
bool | SetKey (const CKeyingMaterial &chNewKey, const std::vector< unsigned char > &chNewIV) |
void | CleanKey () |
CCrypter () | |
~CCrypter () | |
Private Member Functions | |
int | BytesToKeySHA512AES (const std::vector< unsigned char > &chSalt, const SecureString &strKeyData, int count, unsigned char *key, unsigned char *iv) const |
Private Attributes | |
std::vector< unsigned char, secure_allocator< unsigned char > > | vchKey |
std::vector< unsigned char, secure_allocator< unsigned char > > | vchIV |
bool | fKeySet |
Friends | |
class | wallet_crypto::TestCrypter |
Detailed Description
Constructor & Destructor Documentation
◆ CCrypter()
|
inline |
Definition at line 99 of file crypter.h.
References fKeySet, vchIV, vchKey, WALLET_CRYPTO_IV_SIZE, and WALLET_CRYPTO_KEY_SIZE.
◆ ~CCrypter()
|
inline |
Definition at line 106 of file crypter.h.
References CleanKey().
Member Function Documentation
◆ BytesToKeySHA512AES()
|
private |
Definition at line 16 of file crypter.cpp.
References count, CSHA512::Finalize(), memcpy(), memory_cleanse(), CSHA512::OUTPUT_SIZE, CSHA512::Reset(), WALLET_CRYPTO_IV_SIZE, WALLET_CRYPTO_KEY_SIZE, and CSHA512::Write().
Referenced by SetKeyFromPassphrase().
◆ CleanKey()
|
inline |
Definition at line 92 of file crypter.h.
References fKeySet, memory_cleanse(), vchIV, and vchKey.
Referenced by ~CCrypter().
◆ Decrypt()
bool CCrypter::Decrypt | ( | const std::vector< unsigned char > & | vchCiphertext, |
CKeyingMaterial & | vchPlaintext | ||
) | const |
Definition at line 92 of file crypter.cpp.
References AES256CBCDecrypt::Decrypt(), fKeySet, vchIV, and vchKey.
Referenced by CWallet::ChangeWalletPassphrase(), DecryptSecret(), TestCrypter::TestDecrypt(), and CWallet::Unlock().
◆ Encrypt()
bool CCrypter::Encrypt | ( | const CKeyingMaterial & | vchPlaintext, |
std::vector< unsigned char > & | vchCiphertext | ||
) | const |
Definition at line 74 of file crypter.cpp.
References AES_BLOCKSIZE, AES256CBCEncrypt::Encrypt(), fKeySet, vchIV, and vchKey.
Referenced by CWallet::ChangeWalletPassphrase(), EncryptSecret(), CWallet::EncryptWallet(), and TestCrypter::TestEncryptSingle().
◆ SetKey()
bool CCrypter::SetKey | ( | const CKeyingMaterial & | chNewKey, |
const std::vector< unsigned char > & | chNewIV | ||
) |
Definition at line 62 of file crypter.cpp.
References fKeySet, memcpy(), vchIV, vchKey, WALLET_CRYPTO_IV_SIZE, and WALLET_CRYPTO_KEY_SIZE.
Referenced by DecryptSecret(), and EncryptSecret().
◆ SetKeyFromPassphrase()
bool CCrypter::SetKeyFromPassphrase | ( | const SecureString & | strKeyData, |
const std::vector< unsigned char > & | chSalt, | ||
const unsigned int | nRounds, | ||
const unsigned int | nDerivationMethod | ||
) |
Definition at line 42 of file crypter.cpp.
References BytesToKeySHA512AES(), fKeySet, memory_cleanse(), vchIV, vchKey, WALLET_CRYPTO_KEY_SIZE, and WALLET_CRYPTO_SALT_SIZE.
Referenced by BOOST_AUTO_TEST_CASE(), CWallet::ChangeWalletPassphrase(), CWallet::EncryptWallet(), TestCrypter::TestPassphraseSingle(), and CWallet::Unlock().
Friends And Related Function Documentation
◆ wallet_crypto::TestCrypter
Member Data Documentation
◆ fKeySet
|
private |
Definition at line 82 of file crypter.h.
Referenced by CCrypter(), CleanKey(), Decrypt(), Encrypt(), SetKey(), and SetKeyFromPassphrase().
◆ vchIV
|
private |
Definition at line 81 of file crypter.h.
Referenced by CCrypter(), CleanKey(), Decrypt(), Encrypt(), SetKey(), SetKeyFromPassphrase(), and TestCrypter::TestPassphraseSingle().
◆ vchKey
|
private |
Definition at line 80 of file crypter.h.
Referenced by CCrypter(), CleanKey(), Decrypt(), Encrypt(), SetKey(), SetKeyFromPassphrase(), and TestCrypter::TestPassphraseSingle().
The documentation for this class was generated from the following files:
- src/wallet/crypter.h
- src/wallet/crypter.cpp