Expand description
§secp256k1-zkp-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
- A Secp256k1 context, containing various precomputed values and such
needed to do elliptic curve computations. If you create one of these
with
secp256k1_context_createyou MUST destroy it withsecp256k1_context_destroy, or else you will have a memory leak. - Ecdsa
Adaptor Signature - 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 - Pedersen
Commitment - Public
Key - Library-internal representation of a Secp256k1 public key
- Range
Proof - Schnorr
SigExtra Params - Data structure that contains additional arguments for schnorrsig_sign_custom.
- Scratch
Space - Signature
- Library-internal representation of a Secp256k1 signature
- Surjection
Proof - Tag
- Whitelist
Signature - A ring signature for the “whitelist” scheme.
- XOnly
Public Key
Constants§
- ECDSA_
ADAPTOR_ SIGNATURE_ LENGTH - MUSIG_
AGGNONCE_ LEN - MUSIG_
AGGNONCE_ SERIALIZED_ LEN - MUSIG_
KEYAGG_ LEN - MUSIG_
PART_ SIG_ LEN - MUSIG_
PUBNONCE_ LEN - MUSIG_
PUBNONCE_ SERIALIZED_ LEN - MUSIG_
SECNONCE_ LEN - MUSIG_
SESSION_ LEN - RANGEPROOF_
MAX_ LENGTH - Rangeproof maximum length
- 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
- WHITELIST_
MAX_ N_ KEYS - The maximum number of whitelist keys.
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_ ecdsa_ adaptor - 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_ ⚠9_ 2_ context_ create - A reimplementation of the C function
secp256k1_context_createin rust. - rustsecp256k1_
v0_ ⚠9_ 2_ context_ destroy - rustsecp256k1_
v0_ ⚠9_ 2_ 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_ ⚠9_ 2_ 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_ 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_ ⚠adaptor_ decrypt - secp256k1_
ecdsa_ ⚠adaptor_ encrypt - secp256k1_
ecdsa_ ⚠adaptor_ recover - secp256k1_
ecdsa_ ⚠adaptor_ verify - 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_
generator_ ⚠generate_ blinded - secp256k1_
generator_ ⚠parse - secp256k1_
generator_ ⚠serialize - secp256k1_
keypair_ ⚠create - secp256k1_
keypair_ ⚠pub - secp256k1_
keypair_ ⚠sec - secp256k1_
keypair_ ⚠xonly_ pub - secp256k1_
keypair_ ⚠xonly_ tweak_ add - secp256k1_
musig_ ⚠adapt - secp256k1_
musig_ ⚠aggnonce_ parse - secp256k1_
musig_ ⚠aggnonce_ serialize - secp256k1_
musig_ ⚠extract_ adaptor - secp256k1_
musig_ ⚠nonce_ agg - secp256k1_
musig_ ⚠nonce_ gen - secp256k1_
musig_ ⚠nonce_ parity - 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_
pedersen_ ⚠blind_ generator_ blind_ sum - Sets the final Pedersen blinding factor correctly when the generators themselves have blinding factors.
- secp256k1_
pedersen_ ⚠commit - secp256k1_
pedersen_ ⚠commitment_ parse - secp256k1_
pedersen_ ⚠commitment_ serialize - secp256k1_
pedersen_ ⚠verify_ tally - secp256k1_
rangeproof_ ⚠info - secp256k1_
rangeproof_ ⚠rewind - secp256k1_
rangeproof_ ⚠sign - secp256k1_
rangeproof_ ⚠verify - secp256k1_
schnorrsig_ ⚠sign - secp256k1_
schnorrsig_ ⚠sign_ custom - secp256k1_
schnorrsig_ ⚠verify - secp256k1_
surjectionproof_ ⚠generate - secp256k1_
surjectionproof_ ⚠initialize - secp256k1_
surjectionproof_ ⚠parse - secp256k1_
surjectionproof_ ⚠serialize - secp256k1_
surjectionproof_ ⚠serialized_ size - secp256k1_
surjectionproof_ ⚠verify - secp256k1_
whitelist_ ⚠sign - secp256k1_
whitelist_ ⚠signature_ parse - secp256k1_
whitelist_ ⚠signature_ serialize - secp256k1_
whitelist_ ⚠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.
- Ecdsa
Adaptor Nonce Fn - Same as secp256k1_nonce_function_hardened with the exception of using the compressed 33-byte encoding for the pubkey argument.
- Ellswift
Ecdh Hash Fn - A hash function used by
ellswift_ecdhto hash the final ECDH shared secret. - NonceFn
- A nonce generation function. Ordinary users of the library never need to see this type; only if you need to control nonce generation do you need to use it. I have deliberately made this hard to do: you have to write your own wrapper around the FFI functions to use it. And it’s an unsafe type. Nonces are generated deterministically by RFC6979 by default; there should be no need to ever change this.
- Schnorr
Nonce Fn - Same as secp256k1_nonce function with the exception of accepting an additional pubkey argument and not requiring an attempt argument. The pubkey argument can protect signature schemes with key-prefixed challenge hash inputs against reusing the nonce when signing with the wrong precomputed pubkey.