include.secp256k1

Undocumented in source.

Members

Aliases

secp256k1_context
alias secp256k1_context = secp256k1_context_struct
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
secp256k1_nonce_function
alias secp256k1_nonce_function = int function(ubyte* nonce32, const(ubyte)* msg32, const(ubyte)* key32, const(ubyte)* algo16, void* data, uint attempt)

A pointer to a function to deterministically generate a nonce.

secp256k1_scratch_space
alias secp256k1_scratch_space = secp256k1_scratch_space_struct
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Functions

SECP256K1_GNUC_PREREQ
auto SECP256K1_GNUC_PREREQ(T0 _maj, T1 _min)
Undocumented in source. Be warned that the author may not have intended to support it.
secp256k1_context_clone
secp256k1_context* secp256k1_context_clone(const(secp256k1_context)* ctx)

Copy a secp256k1 context object (into dynamically allocated memory).

secp256k1_context_create
secp256k1_context* secp256k1_context_create(uint flags)

Create a secp256k1 context object (in dynamically allocated memory).

secp256k1_context_destroy
void secp256k1_context_destroy(secp256k1_context* ctx)

Destroy a secp256k1 context object (created in dynamically allocated memory).

secp256k1_context_randomize
int secp256k1_context_randomize(secp256k1_context* ctx, const(ubyte)* seed32)

Updates the context randomization to protect against side-channel leakage.

secp256k1_context_set_error_callback
void secp256k1_context_set_error_callback(secp256k1_context* ctx, void function(const(char)* message, void* data) fun, const(void)* data)

Set a callback function to be called when an internal consistency check fails. The default is crashing.

secp256k1_context_set_illegal_callback
void secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void function(const(char)* message, void* data) fun, const(void)* data)

Set a callback function to be called when an illegal argument is passed to an API call. It will only trigger for violations that are mentioned explicitly in the header.

secp256k1_ec_privkey_negate
int secp256k1_ec_privkey_negate(const(secp256k1_context)* ctx, ubyte* seckey)

Same as secp256k1_ec_seckey_negate, but DEPRECATED. Will be removed in * future versions.

secp256k1_ec_privkey_tweak_add
int secp256k1_ec_privkey_tweak_add(const(secp256k1_context)* ctx, ubyte* seckey, const(ubyte)* tweak32)

Same as secp256k1_ec_seckey_tweak_add, but DEPRECATED. Will be removed in * future versions.

secp256k1_ec_privkey_tweak_mul
int secp256k1_ec_privkey_tweak_mul(const(secp256k1_context)* ctx, ubyte* seckey, const(ubyte)* tweak32)

Same as secp256k1_ec_seckey_tweak_mul, but DEPRECATED. Will be removed in * future versions.

secp256k1_ec_pubkey_cmp
int secp256k1_ec_pubkey_cmp(const(secp256k1_context)* ctx, const(secp256k1_pubkey)* pubkey1, const(secp256k1_pubkey)* pubkey2)

Compare two public keys using lexicographic (of compressed serialization) order

secp256k1_ec_pubkey_combine
int secp256k1_ec_pubkey_combine(const(secp256k1_context)* ctx, secp256k1_pubkey* out_, const(secp256k1_pubkey*)* ins, size_t n)

Add a number of public keys together.

secp256k1_ec_pubkey_create
int secp256k1_ec_pubkey_create(const(secp256k1_context)* ctx, secp256k1_pubkey* pubkey, const(ubyte)* seckey)

Compute the public key for a secret key.

secp256k1_ec_pubkey_negate
int secp256k1_ec_pubkey_negate(const(secp256k1_context)* ctx, secp256k1_pubkey* pubkey)

Negates a public key in place.

secp256k1_ec_pubkey_parse
int secp256k1_ec_pubkey_parse(const(secp256k1_context)* ctx, secp256k1_pubkey* pubkey, const(ubyte)* input, size_t inputlen)

Parse a variable-length public key into the pubkey object.

secp256k1_ec_pubkey_serialize
int secp256k1_ec_pubkey_serialize(const(secp256k1_context)* ctx, ubyte* output, size_t* outputlen, const(secp256k1_pubkey)* pubkey, uint flags)

Serialize a pubkey object into a serialized byte sequence.

secp256k1_ec_pubkey_tweak_add
int secp256k1_ec_pubkey_tweak_add(const(secp256k1_context)* ctx, secp256k1_pubkey* pubkey, const(ubyte)* tweak32)

Tweak a public key by adding tweak times the generator to it.

secp256k1_ec_pubkey_tweak_mul
int secp256k1_ec_pubkey_tweak_mul(const(secp256k1_context)* ctx, secp256k1_pubkey* pubkey, const(ubyte)* tweak32)

Tweak a public key by multiplying it by a tweak value.

secp256k1_ec_seckey_negate
int secp256k1_ec_seckey_negate(const(secp256k1_context)* ctx, ubyte* seckey)

Negates a secret key in place.

secp256k1_ec_seckey_tweak_add
int secp256k1_ec_seckey_tweak_add(const(secp256k1_context)* ctx, ubyte* seckey, const(ubyte)* tweak32)

Tweak a secret key by adding tweak to it.

secp256k1_ec_seckey_tweak_mul
int secp256k1_ec_seckey_tweak_mul(const(secp256k1_context)* ctx, ubyte* seckey, const(ubyte)* tweak32)

Tweak a secret key by multiplying it by a tweak.

secp256k1_ec_seckey_verify
int secp256k1_ec_seckey_verify(const(secp256k1_context)* ctx, const(ubyte)* seckey)

Verify an ECDSA secret key.

secp256k1_ecdsa_sign
int secp256k1_ecdsa_sign(const(secp256k1_context)* ctx, secp256k1_ecdsa_signature* sig, const(ubyte)* msghash32, const(ubyte)* seckey, secp256k1_nonce_function noncefp, const(void)* ndata)

Create an ECDSA signature.

secp256k1_ecdsa_signature_normalize
int secp256k1_ecdsa_signature_normalize(const(secp256k1_context)* ctx, secp256k1_ecdsa_signature* sigout, const(secp256k1_ecdsa_signature)* sigin)

Convert a signature to a normalized lower-S form.

secp256k1_ecdsa_signature_parse_compact
int secp256k1_ecdsa_signature_parse_compact(const(secp256k1_context)* ctx, secp256k1_ecdsa_signature* sig, const(ubyte)* input64)

Parse an ECDSA signature in compact (64 bytes) format.

secp256k1_ecdsa_signature_parse_der
int secp256k1_ecdsa_signature_parse_der(const(secp256k1_context)* ctx, secp256k1_ecdsa_signature* sig, const(ubyte)* input, size_t inputlen)

Parse a DER ECDSA signature.

secp256k1_ecdsa_signature_serialize_compact
int secp256k1_ecdsa_signature_serialize_compact(const(secp256k1_context)* ctx, ubyte* output64, const(secp256k1_ecdsa_signature)* sig)

Serialize an ECDSA signature in compact (64 byte) format.

secp256k1_ecdsa_signature_serialize_der
int secp256k1_ecdsa_signature_serialize_der(const(secp256k1_context)* ctx, ubyte* output, size_t* outputlen, const(secp256k1_ecdsa_signature)* sig)

Serialize an ECDSA signature in DER format.

secp256k1_ecdsa_verify
int secp256k1_ecdsa_verify(const(secp256k1_context)* ctx, const(secp256k1_ecdsa_signature)* sig, const(ubyte)* msghash32, const(secp256k1_pubkey)* pubkey)

Verify an ECDSA signature.

secp256k1_scratch_space_create
secp256k1_scratch_space* secp256k1_scratch_space_create(const(secp256k1_context)* ctx, size_t size)

Create a secp256k1 scratch space object.

secp256k1_scratch_space_destroy
void secp256k1_scratch_space_destroy(const(secp256k1_context)* ctx, secp256k1_scratch_space* scratch)

Destroy a secp256k1 scratch space.

secp256k1_tagged_sha256
int secp256k1_tagged_sha256(const(secp256k1_context)* ctx, ubyte* hash32, const(ubyte)* tag, size_t taglen, const(ubyte)* msg, size_t msglen)

Compute a tagged hash as defined in BIP-340.

Manifest constants

SECP256K1_CONTEXT_DECLASSIFY
enum SECP256K1_CONTEXT_DECLASSIFY;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_CONTEXT_NONE
enum SECP256K1_CONTEXT_NONE;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_CONTEXT_SIGN
enum SECP256K1_CONTEXT_SIGN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_CONTEXT_VERIFY
enum SECP256K1_CONTEXT_VERIFY;

Flags to pass to secp256k1_context_create, secp256k1_context_preallocated_size, and * secp256k1_context_preallocated_create.

SECP256K1_EC_COMPRESSED
enum SECP256K1_EC_COMPRESSED;

Flag to pass to secp256k1_ec_pubkey_serialize.

SECP256K1_EC_UNCOMPRESSED
enum SECP256K1_EC_UNCOMPRESSED;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_FLAGS_BIT_COMPRESSION
enum SECP256K1_FLAGS_BIT_COMPRESSION;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_FLAGS_BIT_CONTEXT_DECLASSIFY
enum SECP256K1_FLAGS_BIT_CONTEXT_DECLASSIFY;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_FLAGS_BIT_CONTEXT_SIGN
enum SECP256K1_FLAGS_BIT_CONTEXT_SIGN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_FLAGS_BIT_CONTEXT_VERIFY
enum SECP256K1_FLAGS_BIT_CONTEXT_VERIFY;

The higher bits contain the actual data. Do not use directly.

SECP256K1_FLAGS_TYPE_COMPRESSION
enum SECP256K1_FLAGS_TYPE_COMPRESSION;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_FLAGS_TYPE_CONTEXT
enum SECP256K1_FLAGS_TYPE_CONTEXT;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_FLAGS_TYPE_MASK
enum SECP256K1_FLAGS_TYPE_MASK;

All flags' lower 8 bits indicate what they're for. Do not use directly.

SECP256K1_TAG_PUBKEY_EVEN
enum SECP256K1_TAG_PUBKEY_EVEN;

Prefix byte used to tag various encoded curvepoints for specific purposes

SECP256K1_TAG_PUBKEY_HYBRID_EVEN
enum SECP256K1_TAG_PUBKEY_HYBRID_EVEN;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_TAG_PUBKEY_HYBRID_ODD
enum SECP256K1_TAG_PUBKEY_HYBRID_ODD;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_TAG_PUBKEY_ODD
enum SECP256K1_TAG_PUBKEY_ODD;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SECP256K1_TAG_PUBKEY_UNCOMPRESSED
enum SECP256K1_TAG_PUBKEY_UNCOMPRESSED;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Static variables

secp256k1_context_no_precomp
const(secp256k1_context)* secp256k1_context_no_precomp;

A simple secp256k1 context object with no precomputed tables. These are useful for type serialization/parsing functions which require a context object to maintain API consistency, but currently do not require expensive precomputations or dynamic allocations.

secp256k1_nonce_function_default
secp256k1_nonce_function secp256k1_nonce_function_default;

A default safe nonce generation function (currently equal to secp256k1_nonce_function_rfc6979).

secp256k1_nonce_function_rfc6979
secp256k1_nonce_function secp256k1_nonce_function_rfc6979;

An implementation of RFC6979 (using HMAC-SHA256) as nonce generation function. If a data pointer is passed, it is assumed to be a pointer to 32 bytes of extra entropy.

Structs

secp256k1_context_struct
struct secp256k1_context_struct

Opaque data structure that holds context information (precomputed tables etc.).

secp256k1_ecdsa_signature
struct secp256k1_ecdsa_signature

Opaque data structured that holds a parsed ECDSA signature.

secp256k1_pubkey
struct secp256k1_pubkey

Opaque data structure that holds a parsed and valid public key.

secp256k1_scratch_space_struct
struct secp256k1_scratch_space_struct

Opaque data structure that holds rewriteable "scratch space"

Meta