Function schnorrkel::verify_batch[][src]

pub fn verify_batch<T, I>(
    transcripts: I,
    signatures: &[Signature],
    public_keys: &[PublicKey],
    deduplicate_public_keys: bool
) -> SignatureResult<()> where
    T: SigningTranscript,
    I: IntoIterator<Item = T>, 

Verify a batch of signatures on messages with their respective public_keys.

Inputs

Panics

This function will panic if the messages, signatures, and public_keys` slices are not equal length.

Returns

Examples

use schnorrkel::{Keypair,PublicKey,Signature,verify_batch,signing_context};

let ctx = signing_context(b"some batch");
let mut csprng = rand::thread_rng();
let keypairs: Vec<Keypair> = (0..64).map(|_| Keypair::generate_with(&mut csprng)).collect();
let msg: &[u8] = b"They're good dogs Brant";
let signatures:  Vec<Signature> = keypairs.iter().map(|key| key.sign(ctx.bytes(&msg))).collect();
let public_keys: Vec<PublicKey> = keypairs.iter().map(|key| key.public).collect();

let transcripts = ::std::iter::once(ctx.bytes(msg)).cycle().take(64);

assert!( verify_batch(transcripts, &signatures[..], &public_keys[..], false).is_ok() );