Dash Core  0.12.2.1
P2P Digital Currency
key.cpp File Reference
#include "key.h"
#include "arith_uint256.h"
#include "crypto/common.h"
#include "crypto/hmac_sha512.h"
#include "pubkey.h"
#include "random.h"
#include <secp256k1.h>
#include <secp256k1_recovery.h>

Go to the source code of this file.

Functions

static int ec_privkey_import_der (const secp256k1_context *ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen)
 
static int ec_privkey_export_der (const secp256k1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed)
 
bool ECC_InitSanityCheck ()
 
void ECC_Start ()
 
void ECC_Stop ()
 

Variables

static secp256k1_contextsecp256k1_context_sign = NULL
 

Function Documentation

◆ ec_privkey_export_der()

static int ec_privkey_export_der ( const secp256k1_context ctx,
unsigned char *  privkey,
size_t *  privkeylen,
const unsigned char *  key32,
int  compressed 
)
static

Definition at line 63 of file key.cpp.

Referenced by CKey::GetPrivKey(), test_ecdsa_edge_cases(), and test_ecdsa_end_to_end().

◆ ec_privkey_import_der()

static int ec_privkey_import_der ( const secp256k1_context ctx,
unsigned char *  out32,
const unsigned char *  privkey,
size_t  privkeylen 
)
static

These functions are taken from the libsecp256k1 distribution and are very ugly.

Definition at line 19 of file key.cpp.

Referenced by CKey::Load(), CKey::SetPrivKey(), and test_ecdsa_end_to_end().

◆ ECC_InitSanityCheck()

bool ECC_InitSanityCheck ( void  )

Check that required EC support is available at runtime.

Definition at line 297 of file key.cpp.

Referenced by InitSanityCheck().

◆ ECC_Start()

void ECC_Start ( void  )

Initialize the elliptic curve support. May not be called twice without calling ECC_Stop first.

Definition at line 304 of file key.cpp.

Referenced by AppInit2(), main(), and Secp256k1Init::Secp256k1Init().

◆ ECC_Stop()

void ECC_Stop ( void  )

Deinitialize the elliptic curve support. No-op if ECC_Start wasn't called first.

Definition at line 323 of file key.cpp.

Referenced by main(), Shutdown(), and Secp256k1Init::~Secp256k1Init().

Variable Documentation

◆ secp256k1_context_sign