Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
wallet::CCrypter Class Reference

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_tests::TestCrypter
 

Detailed Description

Encryption/decryption context with key information.

Definition at line 70 of file crypter.h.

Constructor & Destructor Documentation

◆ CCrypter()

wallet::CCrypter::CCrypter ( )
inline

Definition at line 93 of file crypter.h.

◆ ~CCrypter()

wallet::CCrypter::~CCrypter ( )
inline

Definition at line 100 of file crypter.h.

Here is the call graph for this function:

Member Function Documentation

◆ BytesToKeySHA512AES()

int wallet::CCrypter::BytesToKeySHA512AES ( const std::vector< unsigned char > &  chSalt,
const SecureString strKeyData,
int  count,
unsigned char *  key,
unsigned char *  iv 
) const
private

Definition at line 14 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanKey()

void wallet::CCrypter::CleanKey ( )
inline

Definition at line 86 of file crypter.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Decrypt()

bool wallet::CCrypter::Decrypt ( const std::vector< unsigned char > &  vchCiphertext,
CKeyingMaterial vchPlaintext 
) const

Definition at line 90 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Encrypt()

bool wallet::CCrypter::Encrypt ( const CKeyingMaterial vchPlaintext,
std::vector< unsigned char > &  vchCiphertext 
) const

Definition at line 72 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetKey()

bool wallet::CCrypter::SetKey ( const CKeyingMaterial chNewKey,
const std::vector< unsigned char > &  chNewIV 
)

Definition at line 60 of file crypter.cpp.

Here is the caller graph for this function:

◆ SetKeyFromPassphrase()

bool wallet::CCrypter::SetKeyFromPassphrase ( const SecureString strKeyData,
const std::vector< unsigned char > &  chSalt,
const unsigned int  nRounds,
const unsigned int  nDerivationMethod 
)

Definition at line 40 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ wallet_crypto_tests::TestCrypter

friend class wallet_crypto_tests::TestCrypter
friend

Definition at line 72 of file crypter.h.

Member Data Documentation

◆ fKeySet

bool wallet::CCrypter::fKeySet
private

Definition at line 76 of file crypter.h.

◆ vchIV

std::vector<unsigned char, secure_allocator<unsigned char> > wallet::CCrypter::vchIV
private

Definition at line 75 of file crypter.h.

◆ vchKey

std::vector<unsigned char, secure_allocator<unsigned char> > wallet::CCrypter::vchKey
private

Definition at line 74 of file crypter.h.


The documentation for this class was generated from the following files: