Struct secp256k1::Secp256k1 [−][src]
pub struct Secp256k1<C> { /* fields omitted */ }
The secp256k1 engine, used to execute all signature operations
Methods
impl Secp256k1<None>
[src]
impl Secp256k1<None>
pub fn without_caps() -> Secp256k1<None>
[src]
pub fn without_caps() -> Secp256k1<None>
Creates a new Secp256k1 context with no capabilities (just de/serialization)
impl Secp256k1<All>
[src]
impl Secp256k1<All>
impl Secp256k1<SignOnly>
[src]
impl Secp256k1<SignOnly>
pub fn signing_only() -> Secp256k1<SignOnly>
[src]
pub fn signing_only() -> Secp256k1<SignOnly>
Creates a new Secp256k1 context that can only be used for signing
impl Secp256k1<VerifyOnly>
[src]
impl Secp256k1<VerifyOnly>
pub fn verification_only() -> Secp256k1<VerifyOnly>
[src]
pub fn verification_only() -> Secp256k1<VerifyOnly>
Creates a new Secp256k1 context that can only be used for verification
impl<C: Signing> Secp256k1<C>
[src]
impl<C: Signing> Secp256k1<C>
pub fn sign(&self, msg: &Message, sk: &SecretKey) -> Signature
[src]
pub fn sign(&self, msg: &Message, sk: &SecretKey) -> Signature
Constructs a signature for msg
using the secret key sk
and RFC6979 nonce
Requires a signing-capable context.
pub fn sign_recoverable(
&self,
msg: &Message,
sk: &SecretKey
) -> RecoverableSignature
[src]
pub fn sign_recoverable(
&self,
msg: &Message,
sk: &SecretKey
) -> RecoverableSignature
Constructs a signature for msg
using the secret key sk
and RFC6979 nonce
Requires a signing-capable context.
impl<C: Verification> Secp256k1<C>
[src]
impl<C: Verification> Secp256k1<C>
pub fn recover(
&self,
msg: &Message,
sig: &RecoverableSignature
) -> Result<PublicKey, Error>
[src]
pub 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.
pub fn verify(
&self,
msg: &Message,
sig: &Signature,
pk: &PublicKey
) -> Result<(), Error>
[src]
pub 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<C> Send for Secp256k1<C>
[src]
impl<C> Send for Secp256k1<C>
impl<C> Sync for Secp256k1<C>
[src]
impl<C> Sync for Secp256k1<C>
impl<C> Clone for Secp256k1<C>
[src]
impl<C> Clone for Secp256k1<C>
fn clone(&self) -> Secp256k1<C>
[src]
fn clone(&self) -> Secp256k1<C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<C> PartialEq for Secp256k1<C>
[src]
impl<C> PartialEq for Secp256k1<C>
fn eq(&self, _other: &Secp256k1<C>) -> bool
[src]
fn eq(&self, _other: &Secp256k1<C>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<C> Eq for Secp256k1<C>
[src]
impl<C> Eq for Secp256k1<C>
impl<C> Drop for Secp256k1<C>
[src]
impl<C> Drop for Secp256k1<C>