Skip to main content

verify_internal

Function verify_internal 

Source
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 be P::PK_LEN bytes).
  • m_prime: pre-formatted message.
  • sig: encoded signature (must be P::SIG_LEN bytes).

Returns Ok(true) if the signature is valid, Ok(false) otherwise.

§Errors