pub fn verify_internal<P: Params>(
pk: &[u8],
m_prime: &[u8],
sig: &[u8],
) -> Result<bool, MlDsaError>Expand description
Verify a signature against a pre-formatted message.
Implements Algorithm 8 of FIPS 204 (ML-DSA.Verify_internal).
Recomputes the commitment w1’ from the public key, signature components (c_tilde, z, h), and the message hash mu. Verification succeeds when the recomputed commitment hash matches the c_tilde embedded in the signature.
pk: encoded public key (must beP::PK_LENbytes).m_prime: pre-formatted message.sig: encoded signature (must beP::SIG_LENbytes).
Returns Ok(true) if the signature is valid, Ok(false) otherwise.
§Errors
MlDsaError::InvalidPublicKeyifpkhas the wrong length.MlDsaError::InvalidSignatureifsighas the wrong length.