Struct coins_bip32::ecdsa::recoverable::Signature[][src]

pub struct Signature { /* fields omitted */ }

Ethereum-style “recoverable signatures” which allow for the recovery of the signer’s VerifyingKey from the signature itself.

This format consists of Signature followed by a 1-byte recovery Id (65-bytes total):

  • r: 32-byte integer, big endian
  • s: 32-byte integer, big endian
  • v: 1-byte recovery Id

Implementations

impl Signature[src]

Re-exported signer traits

pub fn new(
    signature: &Signature<Secp256k1>,
    recovery_id: Id
) -> Result<Signature, Error>
[src]

Create a new recoverable ECDSA/secp256k1 signature from a regular fixed-size signature and an associated recovery Id.

This is an “unchecked” conversion and assumes the provided Id is valid for this signature.

pub fn recovery_id(self) -> Id[src]

Get the recovery Id for this signature

pub fn from_digest_trial_recovery<D>(
    public_key: &VerifyingKey,
    digest: D,
    signature: &Signature<Secp256k1>
) -> Result<Signature, Error> where
    D: Clone + Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, 
[src]

Given a public key, message digest, and signature, use trial recovery to determine if a suitable recovery ID exists, or return an error otherwise.

pub fn recover_verify_key_from_digest<D>(
    &self,
    msg_digest: D
) -> Result<VerifyingKey, Error> where
    D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, 
[src]

Recover the public key used to create the given signature as a VerifyingKey from the provided precomputed Digest.

pub fn recover_verify_key_from_digest_bytes(
    &self,
    digest_bytes: &GenericArray<u8, <Secp256k1 as Curve>::FieldSize>
) -> Result<VerifyingKey, Error>
[src]

Recover the public key used to create the given signature as a VerifyingKey from the raw bytes of a message digest.

pub fn r(&self) -> NonZeroScalar<Secp256k1>[src]

Parse the r component of this signature to a NonZeroScalar

pub fn s(&self) -> NonZeroScalar<Secp256k1>[src]

Parse the s component of this signature to a NonZeroScalar

Trait Implementations

impl AsRef<[u8]> for Signature[src]

impl Clone for Signature[src]

impl Copy for Signature[src]

impl Debug for Signature[src]

impl<D> DigestSigner<D, Signature> for SigningKey where
    D: BlockInput + FixedOutput<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + Clone + Default + Reset + Update
[src]

impl<D> DigestSigner<D, Signature> for XPriv where
    D: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update
[src]

impl<D> DigestSigner<D, Signature> for DerivedXPriv where
    D: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update
[src]

impl<D> DigestVerifier<D, Signature> for VerifyingKey where
    D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, 
[src]

impl<D> DigestVerifier<D, Signature> for XPub where
    D: Digest<OutputSize = U32>, 
[src]

impl<D> DigestVerifier<D, Signature> for DerivedXPub where
    D: Digest<OutputSize = U32>, 
[src]

impl<D> DigestVerifier<D, Signature> for DerivedPubkey where
    D: Digest<OutputSize = U32>, 
[src]

impl Eq for Signature[src]

impl PartialEq<Signature> for Signature[src]

impl<D> RandomizedDigestSigner<D, Signature> for SigningKey where
    D: BlockInput + FixedOutput<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + Clone + Default + Reset + Update
[src]

impl Signature for Signature[src]

impl<'_> TryFrom<&'_ [u8]> for Signature[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<A, T> AsBits<T> for A where
    T: BitStore + BitMemory,
    A: AsRef<[T]>, 

impl<T> Base32Len for T where
    T: AsRef<[u8]>, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'f, T> CheckBase32<Vec<u5, Global>> for T where
    T: AsRef<[u8]>, 

type Err = Error

Error type if conversion fails

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToBase32 for T where
    T: AsRef<[u8]>, 

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.