Trait coins_bip32::ecdsa::signature::DigestSigner[][src]

pub trait DigestSigner<D, S> where
    D: Digest,
    S: Signature
{ pub fn try_sign_digest(&self, digest: D) -> Result<S, Error>; pub fn sign_digest(&self, digest: D) -> S { ... } }

Sign the given prehashed message Digest using Self.

Notes

This trait is primarily intended for signature algorithms based on the Fiat-Shamir heuristic, a method for converting an interactive challenge/response-based proof-of-knowledge protocol into an offline digital signature through the use of a random oracle, i.e. a digest function.

The security of such protocols critically rests upon the inability of an attacker to solve for the output of the random oracle, as generally otherwise such signature algorithms are a system of linear equations and therefore doing so would allow the attacker to trivially forge signatures.

To prevent misuse which would potentially allow this to be possible, this API accepts a Digest instance, rather than a raw digest value.

Required methods

pub fn try_sign_digest(&self, digest: D) -> Result<S, Error>[src]

Attempt to sign the given prehashed message Digest, returning a digital signature on success, or an error if something went wrong.

Loading content...

Provided methods

pub fn sign_digest(&self, digest: D) -> S[src]

Sign the given prehashed message Digest, returning a signature.

Panics in the event of a signing error.

Loading content...

Implementations on Foreign Types

impl<C, D> DigestSigner<D, Signature<C>> for SigningKey<C> where
    C: ProjectiveArithmetic + Curve,
    D: FixedOutput<OutputSize = <C as Curve>::FieldSize> + BlockInput + Clone + Default + Reset + Update,
    GenericArray<u8, <C as Curve>::FieldSize>: From<<<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar>,
    GenericArray<u8, <C as Curve>::FieldSize>: for<'r> From<&'r <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar>,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: PrimeField,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: FromDigest<C>,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: Invert,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: SignPrimitive<C>,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: Zeroize,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>,
    <<<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar as PrimeField>::Repr == GenericArray<u8, <C as Curve>::FieldSize>,
    <<<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar as Invert>::Output == <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar, 
[src]

pub fn try_sign_digest(&self, digest: D) -> Result<Signature<C>, Error>[src]

Sign message prehash using a deterministic ephemeral scalar (k) computed using the algorithm described in RFC 6979 (Section 3.2): https://tools.ietf.org/html/rfc6979#section-3

Loading content...

Implementors

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

impl<D> DigestSigner<D, Signature> for coins_bip32::ecdsa::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<Secp256k1>> for DerivedXPriv where
    D: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update
[src]

impl<D> DigestSigner<D, Signature<Secp256k1>> for coins_bip32::ecdsa::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<Secp256k1>> for XPriv where
    D: BlockInput + FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update
[src]

Loading content...