Bitcoin Core  0.18.99
P2P Digital Currency
Classes | Namespaces | Typedefs | Functions | Variables
crypter.h File Reference
#include <serialize.h>
#include <support/allocators/secure.h>
#include <script/signingprovider.h>
#include <atomic>
Include dependency graph for crypter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CMasterKey
 Private key encryption is done based on a CMasterKey, which holds a salt and random encryption key. More...
 
class  CCrypter
 Encryption/decryption context with key information. More...
 

Namespaces

 wallet_crypto_tests
 

Typedefs

typedef std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
 

Functions

bool EncryptSecret (const CKeyingMaterial &vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256 &nIV, std::vector< unsigned char > &vchCiphertext)
 
bool DecryptSecret (const CKeyingMaterial &vMasterKey, const std::vector< unsigned char > &vchCiphertext, const uint256 &nIV, CKeyingMaterial &vchPlaintext)
 
bool DecryptKey (const CKeyingMaterial &vMasterKey, const std::vector< unsigned char > &vchCryptedSecret, const CPubKey &vchPubKey, CKey &key)
 

Variables

const unsigned int WALLET_CRYPTO_KEY_SIZE = 32
 
const unsigned int WALLET_CRYPTO_SALT_SIZE = 8
 
const unsigned int WALLET_CRYPTO_IV_SIZE = 16
 

Typedef Documentation

◆ CKeyingMaterial

typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial

Definition at line 68 of file crypter.h.

Function Documentation

◆ DecryptKey()

bool DecryptKey ( const CKeyingMaterial vMasterKey,
const std::vector< unsigned char > &  vchCryptedSecret,
const CPubKey vchPubKey,
CKey key 
)

Definition at line 130 of file crypter.cpp.

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

◆ DecryptSecret()

bool DecryptSecret ( const CKeyingMaterial vMasterKey,
const std::vector< unsigned char > &  vchCiphertext,
const uint256 nIV,
CKeyingMaterial vchPlaintext 
)

Definition at line 120 of file crypter.cpp.

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

◆ EncryptSecret()

bool EncryptSecret ( const CKeyingMaterial vMasterKey,
const CKeyingMaterial vchPlaintext,
const uint256 nIV,
std::vector< unsigned char > &  vchCiphertext 
)

Definition at line 110 of file crypter.cpp.

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

Variable Documentation

◆ WALLET_CRYPTO_IV_SIZE

const unsigned int WALLET_CRYPTO_IV_SIZE = 16

Definition at line 16 of file crypter.h.

◆ WALLET_CRYPTO_KEY_SIZE

const unsigned int WALLET_CRYPTO_KEY_SIZE = 32

Definition at line 14 of file crypter.h.

◆ WALLET_CRYPTO_SALT_SIZE

const unsigned int WALLET_CRYPTO_SALT_SIZE = 8

Definition at line 15 of file crypter.h.