Struct secp256k1::Secp256k1

source ·
pub struct Secp256k1<C> { /* private fields */ }
Expand description

The secp256k1 engine, used to execute all signature operations

Implementations§

Creates a new Secp256k1 context with no capabilities (just de/serialization)

Creates a new Secp256k1 context with all capabilities

Creates a new Secp256k1 context that can only be used for signing

Creates a new Secp256k1 context that can only be used for verification

(Re)randomizes the Secp256k1 context for cheap sidechannel resistance; see comment in libsecp256k1 commit d2275795f by Gregory Maxwell. Requires compilation with “rand” feature.

Constructs a signature for msg using the secret key sk and RFC6979 nonce Requires a signing-capable context.

Constructs a signature for msg using the secret key sk and RFC6979 nonce Requires a signing-capable context.

Generates a random keypair. Convenience function for key::SecretKey::new and key::PublicKey::from_secret_key; call those functions directly for batch key generation. Requires a signing-capable context. Requires compilation with the “rand” feature.

Determines the public key for which sig is a valid signature for msg. Requires a verify-capable context.

Checks that sig is a valid ECDSA signature for msg using the public key pubkey. Returns Ok(true) on success. Note that this function cannot be used for Bitcoin consensus checking since there may exist signatures which OpenSSL would verify but not libsecp256k1, or vice-versa. Requires a verify-capable context.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.