Bitcoin Core  27.99.0
P2P Digital Currency
Classes | Typedefs | Functions | Variables
key.h File Reference
#include <pubkey.h>
#include <serialize.h>
#include <support/allocators/secure.h>
#include <uint256.h>
#include <stdexcept>
#include <vector>
Include dependency graph for key.h:

Go to the source code of this file.

Classes

class  CKey
 An encapsulated private key. More...
 
struct  CExtKey
 

Typedefs

typedef std::vector< unsigned char, secure_allocator< unsigned char > > CPrivKey
 CPrivKey is a serialized private key, with all parameters included (SIZE bytes) More...
 
using ECDHSecret = std::array< std::byte, ECDH_SECRET_SIZE >
 

Functions

CKey GenerateRandomKey (bool compressed=true) noexcept
 
void ECC_Start ()
 Initialize the elliptic curve support. More...
 
void ECC_Stop ()
 Deinitialize the elliptic curve support. More...
 
bool ECC_InitSanityCheck ()
 Check that required EC support is available at runtime. More...
 

Variables

constexpr static size_t ECDH_SECRET_SIZE = CSHA256::OUTPUT_SIZE
 Size of ECDH shared secrets. More...
 

Typedef Documentation

◆ CPrivKey

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

CPrivKey is a serialized private key, with all parameters included (SIZE bytes)

Definition at line 23 of file key.h.

◆ ECDHSecret

using ECDHSecret = std::array<std::byte, ECDH_SECRET_SIZE>

Definition at line 29 of file key.h.

Function Documentation

◆ ECC_InitSanityCheck()

bool ECC_InitSanityCheck ( )

Check that required EC support is available at runtime.

Definition at line 429 of file key.cpp.

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

◆ ECC_Start()

void ECC_Start ( )

Initialize the elliptic curve support.

May not be called twice without calling ECC_Stop first.

Definition at line 435 of file key.cpp.

Here is the caller graph for this function:

◆ ECC_Stop()

void ECC_Stop ( )

Deinitialize the elliptic curve support.

No-op if ECC_Start wasn't called first.

Definition at line 452 of file key.cpp.

◆ GenerateRandomKey()

CKey GenerateRandomKey ( bool  compressed = true)
noexcept

Definition at line 372 of file key.cpp.

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

Variable Documentation

◆ ECDH_SECRET_SIZE

constexpr static size_t ECDH_SECRET_SIZE = CSHA256::OUTPUT_SIZE
staticconstexpr

Size of ECDH shared secrets.

Definition at line 26 of file key.h.