verify

Function verify 

Source
pub fn verify(
    alg: DigestAlgorithm,
    pk: &VarLenPublicKey<'_>,
    msg: &[u8],
    salt_len: u32,
    sig: &[u8],
) -> Result<(), Error>
Expand description

Returns Ok(()) if the provided signature is valid.

Returns an error in any of the following cases:

  • the public key is invalid
  • the signature verification fails
  • the length of msg exceeds u32::MAX
  • salt_len exceeds u32::MAX - alg.hash_len() - 8