batch_verify

Function batch_verify 

Source
pub fn batch_verify(
    items: &[(SchnorrPublicKey, &[u8], SchnorrSignature)],
) -> SchnorrResult<()>
Expand description

Batch verify multiple Schnorr signatures

More efficient than verifying each signature individually using random linear combination.

For each signature (c_i, s_i) with public key P_i and message m_i:

  1. Reconstruct R_i = s_iG + c_iP_i
  2. Verify c_i == H(R_i || P_i || m_i)
  3. Use random linear combination to batch verify: Sum(a_i * R_i) == Sum(a_i * s_i)*G + Sum(a_i * c_i * P_i)

This reduces the number of expensive point operations from 2n to approximately n+2.