INNER CODE UNIT · Rust
batch_check
arkworks-rs/poly-commit · poly-commit/src/lib.rs:373
fn batch_check<'a, R: RngCore>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<P::Point>,
evaluations: &Evaluations<P::Point, F>,
proof: &Self::BatchProof,
sponge: &mut impl CryptographicSponge,
rng: &mut R,
) -> Result<bool, Self::Error>
where
Self::Commitment: 'a,
{
// The default implementation proceeds by rearranging the queries in
// order to gather (i.e. batch) the proofs of all polynomials that should
// have been opened at the same point, then verifying those proofs
// simultaneously with a single call to `check` (per point).
let commitments: BTreeMap<_, _> = commitments.into_iter().map(|c| (c.label(), c)).collect();
let mut query_to_labels_map = BTreeMap::new();