pub fn verify_signature(
    composer: &mut Composer,
    u: Witness,
    r: WitnessPoint,
    pk: WitnessPoint,
    msg: Witness
) -> Result<(), Error>
Expand description

Verifies a single-key Schnorr signature Signaturewithin a Plonk circuit without requiring the secret key as a witness.

The function performs Schnorr verification by calculating the challenge and confirming the signature equation.

Feature

Only available with the “alloc” feature enabled.

Parameters

  • composer: A mutable reference to the Plonk Composer`.
  • u: Witness for the random nonce used during signature generation.
  • r: Witness Point representing the nonce point r = u*G.
  • pk: Witness Point representing the public key pk = sk*G.
  • msg: Witness for the message.

Returns

  • Result<(), Error>: Returns an empty Result on successful gadget creation or an Error if the witness u is not a valid JubJubScalar.

Errors

This function will return an Error if the witness u is not a valid JubJubScalar.