pub struct Secp256k1 { /* private fields */ }
Expand description

The secp256k1 engine, used to execute all signature operations

Implementations§

verify commitment

Creates a pedersen commitment from a value and a blinding factor

Creates a pedersen commitment from a two blinding factors

Convenience method to Create a pedersen commitment only from a value, with a zero blinding factor

Taking vectors of positive and negative commitments as well as an expected excess, verifies that it all sums to zero.

Computes the sum of multiple positive and negative pedersen commitments.

Computes the sum of multiple positive and negative blinding factors.

Compute a blinding factor using a switch commitment

Produces a range proof for the provided value, using min and max bounds, relying on the blinding factor and commitment.

Verify a proof that a committed value is within a range.

Verify a range proof and rewind the proof to recover information sent by its author.

General information extracted from a range proof. Does not provide any information about the value or the message (see rewind).

Produces a bullet proof for the provided value, using min and max bounds, relying on the blinding factor and value. If a message is passed, it will be truncated or padded to exactly BULLET_PROOF_MSG_SIZE bytes

Produces a bullet proof for multi-party commitment

Verify with bullet proof that a committed value is positive

Verify with bullet proof that a committed value is positive

Rewind a bullet proof to get the value and Blinding factor back out

Creates a new Secp256k1 context

Creates a new Secp256k1 context with the specified capabilities

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

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.

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
Executes the destructor for this type. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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.