Skip to main content

DigestVerifier

Trait DigestVerifier 

Source
pub trait DigestVerifier<D: Update, S> {
    // Required method
    fn verify_digest<F: Fn(&mut D) -> Result<(), Error>>(
        &self,
        f: F,
        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 message by updating the received Digest with it, rather than a raw digest value.

Required Methods§

Source

fn verify_digest<F: Fn(&mut D) -> Result<(), Error>>( &self, f: F, signature: &S, ) -> Result<(), Error>

Verify the signature against the received Digest output, by updating it with the message.

The given function can be invoked multiple times. It is expected that in each invocation the Digest is updated with the entire equal message.

§Errors

Returns Error if the provided signature is inauthentic for the given message digest.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§