Bitcoin Core 28.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 &key_data, std::span< const unsigned char > salt, const unsigned int rounds, const unsigned int derivation_method)
 
bool Encrypt (const CKeyingMaterial &vchPlaintext, std::vector< unsigned char > &vchCiphertext) const
 
bool Decrypt (std::span< const unsigned char > ciphertext, CKeyingMaterial &plaintext) const
 
bool SetKey (const CKeyingMaterial &new_key, std::span< const unsigned char > new_iv)
 
void CleanKey ()
 
 CCrypter ()
 
 ~CCrypter ()
 

Private Member Functions

int BytesToKeySHA512AES (std::span< const unsigned char > salt, const SecureString &key_data, 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 ( std::span< const unsigned char >  salt,
const SecureString key_data,
int  count,
unsigned char *  key,
unsigned char *  iv 
) const
private

Definition at line 15 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 ( std::span< const unsigned char >  ciphertext,
CKeyingMaterial plaintext 
) const

Definition at line 94 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 76 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 new_key,
std::span< const unsigned char >  new_iv 
)

Definition at line 63 of file crypter.cpp.

Here is the caller graph for this function:

◆ SetKeyFromPassphrase()

bool wallet::CCrypter::SetKeyFromPassphrase ( const SecureString key_data,
std::span< const unsigned char >  salt,
const unsigned int  rounds,
const unsigned int  derivation_method 
)

Definition at line 41 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: