Skip to main content

PrehashVerifier

Trait PrehashVerifier 

Source
pub trait PrehashVerifier<S> {
    // Required method
    fn verify_prehash(&self, prehash: &[u8], signature: &S) -> Result<(), Error>;
}
Expand description

Verify the provided message prehash using Self (e.g. a public key)

Required Methods§

Source

fn verify_prehash(&self, prehash: &[u8], signature: &S) -> Result<(), Error>

Use Self to verify that the provided signature for a given message prehash is authentic.

The prehash parameter MUST be the output of a secure cryptographic hash function.

Security Warning

If prehash is something other than the output of a cryptographically secure hash function, an attacker can potentially forge signatures by e.g. solving a system of linear equations.

Returns Ok(()) if the signature verified successfully.

§Errors

Returns Error in the event the signature fails to verify or if prehash is an invalid length.

Implementors§