Checks that `values` are the true evaluations at `query_set` of the polynomials committed in `labeled_commitments`.
(
vk: &Self::VerifierKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self
| 588 | /// Checks that `values` are the true evaluations at `query_set` of the polynomials |
| 589 | /// committed in `labeled_commitments`. |
| 590 | fn check_combinations<'a, R: RngCore>( |
| 591 | vk: &Self::VerifierKey, |
| 592 | linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>, |
| 593 | commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, |
| 594 | eqn_query_set: &QuerySet<P::Point>, |
| 595 | eqn_evaluations: &Evaluations<P::Point, E::ScalarField>, |
| 596 | proof: &BatchLCProof<E::ScalarField, Self::BatchProof>, |
| 597 | sponge: &mut impl CryptographicSponge, |
| 598 | rng: &mut R, |
| 599 | ) -> Result<bool, Self::Error> |
| 600 | where |
| 601 | Self::Commitment: 'a, |
| 602 | { |
| 603 | let BatchLCProof { proof, .. } = proof; |
| 604 | let label_comm_map = commitments |
| 605 | .into_iter() |
| 606 | .map(|c| (c.label(), c)) |
| 607 | .collect::<BTreeMap<_, _>>(); |
| 608 | |
| 609 | let mut lc_commitments = Vec::new(); |
| 610 | let mut lc_info = Vec::new(); |
| 611 | let mut evaluations = eqn_evaluations.clone(); |
| 612 | for lc in linear_combinations { |
| 613 | let lc_label = lc.label().clone(); |
| 614 | let num_polys = lc.len(); |
| 615 | |
| 616 | let mut degree_bound = None; |
| 617 | let mut combined_comm = E::G1::zero(); |
| 618 | |
| 619 | for (coeff, label) in lc.iter() { |
| 620 | if label.is_one() { |
| 621 | for (&(ref label, _), ref mut eval) in evaluations.iter_mut() { |
| 622 | if label == &lc_label { |
| 623 | **eval -= coeff; |
| 624 | } |
| 625 | } |
| 626 | } else { |
| 627 | let label: &String = label.try_into().unwrap(); |
| 628 | let &cur_comm = label_comm_map.get(label).ok_or(Error::MissingPolynomial { |
| 629 | label: label.to_string(), |
| 630 | })?; |
| 631 | |
| 632 | if num_polys == 1 && cur_comm.degree_bound().is_some() { |
| 633 | assert!( |
| 634 | coeff.is_one(), |
| 635 | "Coefficient must be one for degree-bounded equations" |
| 636 | ); |
| 637 | degree_bound = cur_comm.degree_bound(); |
| 638 | } else if cur_comm.degree_bound().is_some() { |
| 639 | return Err(Self::Error::EquationHasDegreeBounds(lc_label)); |
| 640 | } |
| 641 | combined_comm += &cur_comm.commitment().0.mul(*coeff); |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | lc_commitments.push(combined_comm); |
| 646 | lc_info.push((lc_label, degree_bound)); |
| 647 | } |
nothing calls this directly
no test coverage detected