Function dusk_schnorr::gadgets::verify_signature
source · 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 Signature
within 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 PlonkComposer
`.u
: Witness for the random nonce used during signature generation.r
: Witness Point representing the nonce pointr = u*G
.pk
: Witness Point representing the public keypk = sk*G
.msg
: Witness for the message.
Returns
Result<(), Error>
: Returns an emptyResult
on successful gadget creation or anError
if the witnessu
is not a validJubJubScalar
.
Errors
This function will return an Error
if the witness u
is not a valid
JubJubScalar
.