pub trait DigestVerifier<D, S>where
    D: Digest,{
    // Required method
    fn verify_digest(&self, digest: D, signature: &S) -> Result<(), Error>;
}
Expand description

Verify the provided signature for the given prehashed message Digest is authentic.

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§

fn verify_digest(&self, digest: D, signature: &S) -> Result<(), Error>

Verify the signature against the given Digest output.

Implementations on Foreign Types§

source§

impl<D> DigestVerifier<D, Signature> for VerifyingKeywhere D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + FixedOutput,

source§

fn verify_digest(&self, digest: D, signature: &Signature) -> Result<(), Error>

§

impl<C, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C>where C: PrimeCurve + CurveArithmetic, D: Digest<OutputSize = <C as Curve>::FieldBytesSize> + FixedOutput, <C as CurveArithmetic>::AffinePoint: VerifyPrimitive<C>, <<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8>,

§

fn verify_digest( &self, msg_digest: D, signature: &Signature<C> ) -> Result<(), Error>

§

impl<C, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C>where C: PrimeCurve + CurveArithmetic, D: Digest<OutputSize = <C as Curve>::FieldBytesSize> + FixedOutput, <C as CurveArithmetic>::AffinePoint: VerifyPrimitive<C>, <<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8> + Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>, <<<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,

§

fn verify_digest( &self, msg_digest: D, signature: &Signature<C> ) -> Result<(), Error>

Implementors§

source§

impl<D> DigestVerifier<D, Signature<Secp256k1>> for DerivedPubkeywhere D: Digest + FixedOutput<OutputSize = U32>,

source§

impl<D> DigestVerifier<D, Signature<Secp256k1>> for DerivedXPubwhere D: Digest + FixedOutput<OutputSize = U32>,

source§

impl<D> DigestVerifier<D, Signature<Secp256k1>> for XPubwhere D: Digest + FixedOutput<OutputSize = U32>,