Expand description
§secp256k1-sys FFI bindings
Direct bindings to the underlying C library functions. These should not be needed for most users.
Modules§
Macros§
- impl_
array_ newtype - Implement methods and traits for types that contain an inner array.
- impl_
raw_ debug
Structs§
- Context
- An opaque Secp256k1 context.
- Elligator
Swift - Library-internal representation of a ElligatorSwift encoded group element.
- Keypair
- Musig
AggNonce - Musig
KeyAgg Cache - Musig
Partial Signature - Musig
PubNonce - Musig
SecNonce - Musig
Session - Public
Key - Library-internal representation of a Secp256k1 public key
- Schnorr
SigExtra Params - Data structure that contains additional arguments for schnorrsig_sign_custom.
- Signature
- Library-internal representation of a Secp256k1 signature
- XOnly
Public Key
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).
- SECP256
K1_ SER_ COMPRESSED - Flag for keys to indicate compressed serialization format
- SECP256
K1_ SER_ UNCOMPRESSED - Flag for keys to indicate uncompressed serialization format
- SECP256
K1_ START_ NONE - Flag for context to enable no precomputation
- SECP256
K1_ START_ SIGN - Flag for context to enable signing precomputation
- SECP256
K1_ 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_createin 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_createin rust. - secp256k1_
context_ ⚠destroy - A reimplementation of the C function
secp256k1_context_destroyin 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§
- Ecdh
Hash Fn - Hash function to use to post-process an ECDH point to get a shared secret.
- Ellswift
Ecdh Hash Fn - A hash function used by
ellswift_ecdhto hash the final ECDH shared secret. - NonceFn
- A nonce generation function.
- Schnorr
Nonce Fn - Same as
NonceFn, but accepts an additional pubkey argument and does not accept an attempt argument.