# Struct ethkey::SECP256K1 [−]

    pub struct SECP256K1 { /* fields omitted */ }

## Methods from __Deref<Target=Secp256k1>

#### `fn sign_schnorr(&self,
msg: &Message,
sk: &SecretKey)
-> Result<Signature, Error>`

Create a Schnorr signature

#### `fn verify_schnorr(&self,
msg: &Message,
sig: &Signature,
pk: &PublicKey)
-> Result<(), Error>`

Verify a Schnorr signature

#### `fn recover_schnorr(&self,
msg: &Message,
sig: &Signature)
-> Result<PublicKey, Error>`

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

#### `fn generate_keypair<R>(&self,
rng: &mut R)
-> Result<(SecretKey, PublicKey), Error> where R: Rng`

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.

#### `fn sign(&self, msg: &Message, sk: &SecretKey) -> Result<Signature, Error>`

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

#### `fn sign_recoverable(&self,
msg: &Message,
sk: &SecretKey)
-> Result<RecoverableSignature, Error>`

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

#### `fn recover(&self,
msg: &Message,
sig: &RecoverableSignature)
-> Result<PublicKey, Error>`

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

#### `fn verify(&self,
msg: &Message,
sig: &Signature,
pk: &PublicKey)
-> Result<(), Error>`

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

### `impl __Deref for SECP256K1`

#### `type Target = Secp256k1`

The resulting type after dereferencing

#### `fn deref<'a>(&'a self) -> &'a Secp256k1`

The method called to dereference a value

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)