![]() |
Bitcoin Core 32.99.0
P2P Digital Currency
|
#include <key.h>#include <crypto/common.h>#include <crypto/hmac_sha512.h>#include <hash.h>#include <random.h>#include <secp256k1.h>#include <secp256k1_ellswift.h>#include <secp256k1_extrakeys.h>#include <secp256k1_recovery.h>#include <secp256k1_schnorrsig.h>#include <algorithm>Go to the source code of this file.
Functions | |
| int | ec_seckey_import_der (const secp256k1_context *ctx, unsigned char *out32, const unsigned char *seckey, size_t seckeylen) |
| These functions are taken from the libsecp256k1 distribution and are very ugly. | |
| int | ec_seckey_export_der (const secp256k1_context *ctx, unsigned char *seckey, size_t *seckeylen, const unsigned char *key32, bool compressed) |
| This serializes to a DER encoding of the ECPrivateKey type from section C.4 of SEC 1 https://www.secg.org/sec1-v2.pdf. | |
| bool | SigHasLowR (const secp256k1_ecdsa_signature *sig) |
| CKey | GenerateRandomKey (bool compressed) noexcept |
| std::optional< std::pair< CExtKey, KeyOriginInfo > > | DeriveExtKey (const CExtKey &ext_key, const std::vector< uint32_t > &path) |
| Get extended key and origin info for a given path. | |
| bool | ECC_InitSanityCheck () |
| Check that required EC support is available at runtime. | |
| secp256k1_context * | GetSecp256k1SignContext () |
| Access the secp256k1 context used for signing and MuSig2 nonce generation. | |
| static void | ECC_Start () |
| Initialize the elliptic curve support. | |
| static void | ECC_Stop () |
| Deinitialize the elliptic curve support. | |
Variables | |
| static secp256k1_context * | secp256k1_context_sign = nullptr |
| std::optional< std::pair< CExtKey, KeyOriginInfo > > DeriveExtKey | ( | const CExtKey & | ext_key, |
| const std::vector< uint32_t > & | path | ||
| ) |
Get extended key and origin info for a given path.
| [in] | ext_key | The extended private key to derive from |
| [in] | path | The BIP 32 path |
Definition at line 369 of file key.cpp.
| int ec_seckey_export_der | ( | const secp256k1_context * | ctx, |
| unsigned char * | seckey, | ||
| size_t * | seckeylen, | ||
| const unsigned char * | key32, | ||
| bool | compressed | ||
| ) |
This serializes to a DER encoding of the ECPrivateKey type from section C.4 of SEC 1 https://www.secg.org/sec1-v2.pdf.
The optional parameters and publicKey fields are included.
seckey must point to an output buffer of length at least CKey::SIZE bytes. seckeylen must initially be set to the size of the seckey 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.
Definition at line 97 of file key.cpp.
| int ec_seckey_import_der | ( | const secp256k1_context * | ctx, |
| unsigned char * | out32, | ||
| const unsigned char * | seckey, | ||
| size_t | seckeylen | ||
| ) |
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 https://www.secg.org/sec1-v2.pdf, with the following caveats:
out32 must point to an output buffer of length at least 32 bytes.
Definition at line 40 of file key.cpp.
| bool ECC_InitSanityCheck | ( | ) |
| secp256k1_context * GetSecp256k1SignContext | ( | ) |
| bool SigHasLowR | ( | const secp256k1_ecdsa_signature * | sig | ) |
|
static |