[][src]Crate secp256k1_abc_sys

Structs

secp256k1_context_struct
secp256k1_pubkey

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

secp256k1_ecdsa_signature

Opaque data structured that holds a parsed ECDSA signature.

secp256k1_multiset

Opaque multiset; this is actually a group element

secp256k1_ecdsa_recoverable_signature

Opaque data structured that holds a parsed ECDSA signature, supporting pubkey recovery.

Constants

SECP256K1_FLAGS_TYPE_MASK
SECP256K1_FLAGS_TYPE_CONTEXT
SECP256K1_FLAGS_TYPE_COMPRESSION
SECP256K1_FLAGS_BIT_CONTEXT_VERIFY
SECP256K1_FLAGS_BIT_CONTEXT_SIGN
SECP256K1_FLAGS_BIT_COMPRESSION
SECP256K1_CONTEXT_VERIFY
SECP256K1_CONTEXT_SIGN
SECP256K1_CONTEXT_NONE
SECP256K1_EC_COMPRESSED
SECP256K1_EC_UNCOMPRESSED
SECP256K1_TAG_PUBKEY_EVEN
SECP256K1_TAG_PUBKEY_ODD
SECP256K1_TAG_PUBKEY_UNCOMPRESSED
SECP256K1_TAG_PUBKEY_HYBRID_EVEN
SECP256K1_TAG_PUBKEY_HYBRID_ODD

Statics

secp256k1_nonce_function_default
secp256k1_nonce_function_rfc6979

Functions

secp256k1_context_create

Create a secp256k1 context object.

secp256k1_context_clone

Copies a secp256k1 context object.

secp256k1_context_destroy

Destroy a secp256k1 context object.

secp256k1_context_set_illegal_callback

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_context_set_error_callback

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

secp256k1_ec_pubkey_parse

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

secp256k1_ec_pubkey_serialize

Serialize a pubkey object into a serialized byte sequence.

secp256k1_ecdsa_signature_parse_compact

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

secp256k1_ecdsa_signature_parse_der

Parse a DER ECDSA signature.

secp256k1_ecdsa_signature_serialize_der

Serialize an ECDSA signature in DER format.

secp256k1_ecdsa_signature_serialize_compact

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

secp256k1_ecdsa_verify

Verify an ECDSA signature.

secp256k1_ecdsa_signature_normalize

Convert a signature to a normalized lower-S form.

secp256k1_ecdsa_sign

Create an ECDSA signature.

secp256k1_ec_seckey_verify

Verify an ECDSA secret key.

secp256k1_ec_pubkey_create

Compute the public key for a secret key.

secp256k1_ec_privkey_negate

Negates a private key in place.

secp256k1_ec_pubkey_negate

Negates a public key in place.

secp256k1_ec_privkey_tweak_add

Tweak a private key by adding tweak to it. Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for uniformly random 32-byte arrays, or if the resulting private key would be invalid (only when the tweak is the complement of the private key). 1 otherwise. Args: ctx: pointer to a context object (cannot be NULL). In/Out: seckey: pointer to a 32-byte private key. In: tweak: pointer to a 32-byte tweak.

secp256k1_ec_pubkey_tweak_add

Tweak a public key by adding tweak times the generator to it. Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for uniformly random 32-byte arrays, or if the resulting public key would be invalid (only when the tweak is the complement of the corresponding private key). 1 otherwise. Args: ctx: pointer to a context object initialized for validation (cannot be NULL). In/Out: pubkey: pointer to a public key object. In: tweak: pointer to a 32-byte tweak.

secp256k1_ec_privkey_tweak_mul

Tweak a private key by multiplying it by a tweak. Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for uniformly random 32-byte arrays, or equal to zero. 1 otherwise. Args: ctx: pointer to a context object (cannot be NULL). In/Out: seckey: pointer to a 32-byte private key. In: tweak: pointer to a 32-byte tweak.

secp256k1_ec_pubkey_tweak_mul

Tweak a public key by multiplying it by a tweak value. Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for uniformly random 32-byte arrays, or equal to zero. 1 otherwise. Args: ctx: pointer to a context object initialized for validation (cannot be NULL). In/Out: pubkey: pointer to a public key obkect. In: tweak: pointer to a 32-byte tweak.

secp256k1_context_randomize

Updates the context randomization to protect against side-channel leakage. Returns: 1: randomization successfully updated 0: error Args: ctx: pointer to a context object (cannot be NULL) In: seed32: pointer to a 32-byte random seed (NULL resets to initial state)

secp256k1_ec_pubkey_combine

Add a number of public keys together. Returns: 1: the sum of the public keys is valid. 0: the sum of the public keys is not valid. Args: ctx: pointer to a context object Out: out: pointer to a public key object for placing the resulting public key (cannot be NULL) In: ins: pointer to array of pointers to public keys (cannot be NULL) n: the number of public keys to add together (must be at least 1)

secp256k1_ecdh

Compute an EC Diffie-Hellman secret in constant time Returns: 1: exponentiation was successful 0: scalar was invalid (zero or overflow) Args: ctx: pointer to a context object (cannot be NULL) Out: result: a 32-byte array which will be populated by an ECDH secret computed from the point and scalar In: pubkey: a pointer to a secp256k1_pubkey containing an initialized public key privkey: a 32-byte scalar with which to multiply the point

secp256k1_multiset_init

Initialize a multiset The resulting multiset the multiset for no data elements

secp256k1_multiset_add

Adds an element to a multiset from single data element

secp256k1_multiset_remove

Removes an element from a multiset

secp256k1_multiset_combine

Combines two multisets

secp256k1_multiset_finalize

Converts a multiset to a hash

secp256k1_ecdsa_recoverable_signature_parse_compact

Parse a compact ECDSA signature (64 bytes + recovery id).

secp256k1_ecdsa_recoverable_signature_convert

Convert a recoverable signature into a normal signature.

secp256k1_ecdsa_recoverable_signature_serialize_compact

Serialize an ECDSA signature in compact format (64 bytes + recovery id).

secp256k1_ecdsa_sign_recoverable

Create a recoverable ECDSA signature.

secp256k1_ecdsa_recover

Recover an ECDSA public key from a signature.

secp256k1_schnorr_verify

Verify a signature created by secp256k1_schnorr_sign. Returns: 1: correct signature 0: incorrect signature Args: ctx: a secp256k1 context object, initialized for verification. In: sig64: the 64-byte signature being verified (cannot be NULL) msg32: the 32-byte message hash being verified (cannot be NULL) pubkey: the public key to verify with (cannot be NULL)

secp256k1_schnorr_sign

Create a signature using a custom EC-Schnorr-SHA256 construction. It produces non-malleable 64-byte signatures which support batch validation, and multiparty signing. Returns: 1: signature created 0: the nonce generation function failed, or the private key was invalid. Args: ctx: pointer to a context object, initialized for signing (cannot be NULL) Out: sig64: pointer to a 64-byte array where the signature will be placed (cannot be NULL) In: msg32: the 32-byte message hash being signed (cannot be NULL) seckey: pointer to a 32-byte secret key (cannot be NULL) noncefp:pointer to a nonce generation function. If NULL, secp256k1_nonce_function_default is used ndata: pointer to arbitrary data used by the nonce generation function (can be NULL)

Type Definitions

max_align_t
secp256k1_context

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

secp256k1_nonce_function

A pointer to a function to deterministically generate a nonce.

wchar_t