Crate secp256k1_sys

Source
Expand description

§secp256k1-sys FFI bindings

Direct bindings to the underlying C library functions. These should not be needed for most users.

Modules§

types

Macros§

impl_array_newtype
Implement methods and traits for types that contain an inner array.
impl_raw_debug

Structs§

Context
An opaque Secp256k1 context.
ElligatorSwift
Library-internal representation of a ElligatorSwift encoded group element.
Keypair
MusigAggNonce
MusigKeyAggCache
MusigPartialSignature
MusigPubNonce
MusigSecNonce
MusigSession
PublicKey
Library-internal representation of a Secp256k1 public key
SchnorrSigExtraParams
Data structure that contains additional arguments for schnorrsig_sign_custom.
Signature
Library-internal representation of a Secp256k1 signature
XOnlyPublicKey

Constants§

MUSIG_AGGNONCE_SIZE
Size (in bytes) of the aggregated nonce structure. Represents the combined nonce obtained by aggregating the individual public nonces from all participants for the final signature computation.
MUSIG_KEYAGG_SIZE
Total size (in bytes) of the key aggregation context. This structure packs all metadata needed for aggregating individual public keys into a single MuSig2 aggregated key (including coefficients and any extra metadata).
MUSIG_PART_SIG_SIZE
Size (in bytes) of the internal representation of a partial signature. This structure include magic bytes ([0xeb, 0xfb, 0x1a, 0x32]) alongside the actual signature scalar.
MUSIG_PUBNONCE_SIZE
Size (in bytes) of the public nonce structure. This is derived from the secret nonce and shared among participants to build nonce commitments in the MuSig2 protocol.
MUSIG_SECNONCE_SIZE
Size (in bytes) of the secret nonce structure used in a MuSig2 session. It holds the secret (ephemeral) nonces used internally for nonce derivation before the corresponding public nonces are computed.
MUSIG_SESSION_SIZE
Size (in bytes) of the session structure. The session object holds all state needed for a MuSig2 signing session (e.g. aggregated nonce, key aggregation info, and other state necessary for computing partial signatures).
SECP256K1_SER_COMPRESSED
Flag for keys to indicate compressed serialization format
SECP256K1_SER_UNCOMPRESSED
Flag for keys to indicate uncompressed serialization format
SECP256K1_START_NONE
Flag for context to enable no precomputation
SECP256K1_START_SIGN
Flag for context to enable signing precomputation
SECP256K1_START_VERIFY
Flag for context to enable verification precomputation

Statics§

secp256k1_context_no_precomp
secp256k1_ecdh_hash_function_default
Default ECDH hash function
secp256k1_ellswift_xdh_hash_function_bip324
Default ECDH hash function for BIP324 key establishment
secp256k1_nonce_function_bip340
secp256k1_nonce_function_default
secp256k1_nonce_function_rfc6979

Traits§

CPtr
A trait for producing pointers that will always be valid in C (assuming NULL pointer is a valid no-op).

Functions§

ecdsa_signature_parse_der_lax
non_secure_erase_impl
Does a best attempt at secure erasure using Rust intrinsics.
rustsecp256k1_v0_12_context_create
A reimplementation of the C function secp256k1_context_create in rust.
rustsecp256k1_v0_12_context_destroy
rustsecp256k1_v0_12_default_error_callback_fn
This function is an override for the C function, this is the an edited version of the original description:
rustsecp256k1_v0_12_default_illegal_callback_fn
This function is an override for the C function, this is the an edited version of the original description:
secp256k1_context_create
A reimplementation of the C function secp256k1_context_create in rust.
secp256k1_context_destroy
A reimplementation of the C function secp256k1_context_destroy in rust.
secp256k1_context_preallocated_clone
secp256k1_context_preallocated_clone_size
secp256k1_context_preallocated_create
secp256k1_context_preallocated_destroy
secp256k1_context_preallocated_size
secp256k1_context_randomize
secp256k1_ec_pubkey_cmp
secp256k1_ec_pubkey_combine
secp256k1_ec_pubkey_create
secp256k1_ec_pubkey_negate
secp256k1_ec_pubkey_parse
secp256k1_ec_pubkey_serialize
secp256k1_ec_pubkey_sort
secp256k1_ec_pubkey_tweak_add
secp256k1_ec_pubkey_tweak_mul
secp256k1_ec_seckey_negate
secp256k1_ec_seckey_tweak_add
secp256k1_ec_seckey_tweak_mul
secp256k1_ec_seckey_verify
secp256k1_ecdh
secp256k1_ecdsa_sign
secp256k1_ecdsa_signature_normalize
secp256k1_ecdsa_signature_parse_compact
secp256k1_ecdsa_signature_parse_der
secp256k1_ecdsa_signature_serialize_compact
secp256k1_ecdsa_signature_serialize_der
secp256k1_ecdsa_verify
secp256k1_ellswift_create
secp256k1_ellswift_decode
secp256k1_ellswift_encode
secp256k1_ellswift_xdh
secp256k1_keypair_create
secp256k1_keypair_pub
secp256k1_keypair_sec
secp256k1_keypair_xonly_pub
secp256k1_keypair_xonly_tweak_add
secp256k1_musig_aggnonce_parse
secp256k1_musig_aggnonce_serialize
secp256k1_musig_nonce_agg
secp256k1_musig_nonce_gen
secp256k1_musig_nonce_process
secp256k1_musig_partial_sig_agg
secp256k1_musig_partial_sig_parse
secp256k1_musig_partial_sig_serialize
secp256k1_musig_partial_sig_verify
secp256k1_musig_partial_sign
secp256k1_musig_pubkey_agg
secp256k1_musig_pubkey_ec_tweak_add
secp256k1_musig_pubkey_get
secp256k1_musig_pubkey_xonly_tweak_add
secp256k1_musig_pubnonce_parse
secp256k1_musig_pubnonce_serialize
secp256k1_schnorrsig_sign
secp256k1_schnorrsig_sign_custom
secp256k1_schnorrsig_verify
secp256k1_xonly_pubkey_cmp
secp256k1_xonly_pubkey_from_pubkey
secp256k1_xonly_pubkey_parse
secp256k1_xonly_pubkey_serialize
secp256k1_xonly_pubkey_tweak_add
secp256k1_xonly_pubkey_tweak_add_check

Type Aliases§

EcdhHashFn
Hash function to use to post-process an ECDH point to get a shared secret.
EllswiftEcdhHashFn
A hash function used by ellswift_ecdh to hash the final ECDH shared secret.
NonceFn
A nonce generation function.
SchnorrNonceFn
Same as NonceFn, but accepts an additional pubkey argument and does not accept an attempt argument.