Bitcoin
|
#include <key.h>
#include <crypto/common.h>
#include <crypto/hmac_sha512.h>
#include <random.h>
#include <secp256k1.h>
#include <secp256k1_recovery.h>
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, bool compressed) |
bool | SigHasLowR (const secp256k1_ecdsa_signature *sig) |
bool | ECC_InitSanityCheck () |
void | ECC_Start () |
void | ECC_Stop () |
Variables | |
static secp256k1_context * | secp256k1_context_sign = nullptr |
|
static |
This serializes to a DER encoding of the ECPrivateKey type from section C.4 of SEC 1 http://www.secg.org/sec1-v2.pdf. The optional parameters and publicKey fields are included.
privkey must point to an output buffer of length at least CKey::PRIVATE_KEY_SIZE bytes. privkeylen must initially be set to the size of the privkey buffer. Upon return it will be set to the number of bytes used in the buffer. key32 must point to a 32-byte raw private key.
|
static |
These functions are taken from the libsecp256k1 distribution and are very ugly. This parses a format loosely based on a DER encoding of the ECPrivateKey type from section C.4 of SEC 1 http://www.secg.org/sec1-v2.pdf, with the following caveats:
out32 must point to an output buffer of length at least 32 bytes.
bool ECC_InitSanityCheck | ( | ) |
Check that required EC support is available at runtime.
void ECC_Start | ( | ) |
Initialize the elliptic curve support. May not be called twice without calling ECC_Stop first.
void ECC_Stop | ( | ) |
Deinitialize the elliptic curve support. No-op if ECC_Start wasn't called first.
bool SigHasLowR | ( | const secp256k1_ecdsa_signature * | sig | ) |
|
static |