Skip to main content

verify

Function verify 

Source
pub fn verify(
    verifying_key: &VerifyingKey,
    payload: &[u8],
    timestamp: i64,
    signature: &Signature,
) -> bool
Expand description

Verify a signature against a payload and timestamp.

Returns true if the signature is valid.

Uses VerifyingKey::verify_strict so that small-order public keys are rejected at the library layer. Without this, a public key that happens to be the identity element (or any other low-order point) admits trivial signature forgery via the identity-element attack: an attacker picks any scalar s, sets R = s·B, and produces a signature (R, s) that verifies against any message with ~25% probability under the cofactored verification equation. Empirically confirmed against a prod row with public_key = [0u8; 32]. Strict verification rejects the attack at the crypto boundary as a defense-in-depth layer; the application-layer FORBIDDEN_AGENT_IDS check is the first line.