fn batch_open<'a>(
        ck: &Self::CommitterKey,
        labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<'a, F>>,
        commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
        query_set: &QuerySet<F>,
        opening_challenge: F,
        rands: impl IntoIterator<Item = &'a Self::Randomness>,
        rng: Option<&mut dyn RngCore>,
    ) -> Result<Self::BatchProof, Self::Error>
    where
        Self::Randomness: 'a,
        Self::Commitment: 'a,
    {
        let rng = &mut crate::optional_rng::OptionalRng(rng);
        let poly_rand_comm: BTreeMap<_, _> = labeled_polynomials
            .into_iter()
            .zip(rands)
            .zip(commitments.into_iter())
            .map(|((poly, r), comm)| (poly.label(), (poly, r, comm)))
            .collect();

        let open_time = start_timer!(|| format!(
            "Opening {} polynomials at query set of size {}",
            poly_rand_comm.len(),
            query_set.len(),
        ));

        let mut query_to_labels_map = BTreeMap::new();

        for (label, point) in query_set.iter() {
            let labels = query_to_labels_map.entry(point).or_insert(BTreeSet::new());
            labels.insert(label);
        }

        let mut proofs = Vec::new();
        for (query, labels) in query_to_labels_map.into_iter() {
            let mut query_polys: Vec<&'a LabeledPolynomial<'a, _>> = Vec::new();
            let mut query_rands: Vec<&'a Self::Randomness> = Vec::new();
            let mut query_comms: Vec<&'a LabeledCommitment<Self::Commitment>> = Vec::new();

            for label in labels {
                let (polynomial, rand, comm) = poly_rand_comm.get(label).ok_or(Error::MissingPolynomial {
                    label: label.to_string(),
                })?;

                query_polys.push(polynomial);
                query_rands.push(rand);
                query_comms.push(comm);
            }

            let proof_time = start_timer!(|| "Creating proof");
            let proof = Self::open(
                ck,
                query_polys,
                query_comms,
                *query,
                opening_challenge,
                query_rands,
                Some(rng),
            )?;

            end_timer!(proof_time);

            proofs.push(proof);
        }
        end_timer!(open_time);

        Ok(proofs.into())
    }
/// On input a list of labeled polynomials and a query set, `open` outputs a proof of evaluation
/// of the polynomials at the points in the query set.
On input a list of labeled polynomials and a query set, `open` outputs a proof of evaluation
of the polynomials at the points in the query set.
On input a list of labeled polynomials and a query set ` open ` outputs a proof of evaluation of the polynomials at the points in the query set .
fn batch_open<'a>(
        ck: &Self::CommitterKey,
        labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<'a, F>>,
        commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
        query_set: &QuerySet<F>,
        opening_challenge: F,
        rands: impl IntoIterator<Item = &'a Self::Randomness>,
        rng: Option<&mut dyn RngCore>,
    ) -> Result<Self::BatchProof, Self::Error>
    where
        Self::Randomness: 'a,
        Self::Commitment: 'a,
    {
        let rng = &mut crate::optional_rng::OptionalRng(rng);
        let poly_rand_comm: BTreeMap<_, _> = labeled_polynomials
            .into_iter()
            .zip(rands)
            .zip(commitments.into_iter())
            .map(|((poly, r), comm)| (poly.label(), (poly, r, comm)))
            .collect();
        let open_time = start_timer!(|| format!(
            "Opening {} polynomials at query set of size {}",
            poly_rand_comm.len(),
            query_set.len(),
        ));
        let mut query_to_labels_map = BTreeMap::new();
        for (label, point) in query_set.iter() {
            let labels = query_to_labels_map.entry(point).or_insert(BTreeSet::new());
            labels.insert(label);
        }
        let mut proofs = Vec::new();
        for (query, labels) in query_to_labels_map.into_iter() {
            let mut query_polys: Vec<&'a LabeledPolynomial<'a, _>> = Vec::new();
            let mut query_rands: Vec<&'a Self::Randomness> = Vec::new();
            let mut query_comms: Vec<&'a LabeledCommitment<Self::Commitment>> = Vec::new();
            for label in labels {
                let (polynomial, rand, comm) = poly_rand_comm.get(label).ok_or(Error::MissingPolynomial {
                    label: label.to_string(),
                })?;
                query_polys.push(polynomial);
                query_rands.push(rand);
                query_comms.push(comm);
            }
            let proof_time = start_timer!(|| "Creating proof");
            let proof = Self::open(
                ck,
                query_polys,
                query_comms,
                *query,
                opening_challenge,
                query_rands,
                Some(rng),
            )?;
            end_timer!(proof_time);
            proofs.push(proof);
        }
        end_timer!(open_time);
        Ok(proofs.into())
    }
fn batch_open < ' a > ( ck : & Self :: CommitterKey , labeled_polynomials : impl IntoIterator < Item = & ' a LabeledPolynomial < ' a , F > > , commitments : impl IntoIterator < Item = & ' a LabeledCommitment < Self :: Commitment > > , query_set : & QuerySet < F > , opening_challenge : F , rands : impl IntoIterator < Item = & ' a Self :: Randomness > , rng : Option < & mut dyn RngCore > , ) -> Result < Self :: BatchProof , Self :: Error > where Self :: Randomness : ' a , Self :: Commitment : ' a , { let rng = & mut crate :: optional_rng :: OptionalRng ( rng ) ; let poly_rand_comm : BTreeMap < _ , _ > = labeled_polynomials . into_iter ( ) . zip ( rands ) . zip ( commitments . into_iter ( ) ) . map ( | ( ( poly , r ) , comm ) | ( poly . label ( ) , ( poly , r , comm ) ) ) . collect ( ) ; let open_time = start_timer ! ( format ( " " poly_rand_comm len ( ) query_set len ( ) ) ) ; let mut query_to_labels_map = BTreeMap :: new ( ) ; for ( label , point ) in query_set . iter ( ) { let labels = query_to_labels_map . entry ( point ) . or_insert ( BTreeSet :: new ( ) ) ; labels . insert ( label ) ; } let mut proofs = Vec :: new ( ) ; for ( query , labels ) in query_to_labels_map . into_iter ( ) { let mut query_polys : Vec < & ' a LabeledPolynomial < ' a , _ > > = Vec :: new ( ) ; let mut query_rands : Vec < & ' a Self :: Randomness > = Vec :: new ( ) ; let mut query_comms : Vec < & ' a LabeledCommitment < Self :: Commitment > > = Vec :: new ( ) ; for label in labels { let ( polynomial , rand , comm ) = poly_rand_comm . get ( label ) . ok_or ( Error :: MissingPolynomial { label : label . to_string ( ) , } ) ? ; query_polys . push ( polynomial ) ; query_rands . push ( rand ) ; query_comms . push ( comm ) ; } let proof_time = start_timer ! ( " " ) ; let proof = Self :: open ( ck , query_polys , query_comms , * query , opening_challenge , query_rands , Some ( rng ) , ) ? ; end_timer ! ( proof_time ) ; proofs . push ( proof ) ; } end_timer ! ( open_time ) ; Ok ( proofs . into ( ) ) }
On input a list of labeled polynomials and a query set, `open` outputs a proof of evaluation
of the polynomials at the points in the query set.
On input a list of labeled polynomials and a query set ` open ` outputs a proof of evaluation of the polynomials at the points in the query set .
ck
&Self::CommitterKey
labeled_polynomials
impl IntoIterator<Item = &'a LabeledPolynomial<'a, F>>
commitments
impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>
query_set
&QuerySet<F>
opening_challenge
F
rands
impl IntoIterator<Item = &'a Self::Randomness>
rng
Option<&mut dyn RngCore>
ck
&Self::CommitterKey
labeled_polynomials
impl IntoIterator<Item = &'a LabeledPolynomial<'a, F>>
commitments
impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>
query_set
&QuerySet<F>
opening_challenge
F
rands
impl IntoIterator<Item = &'a Self::Randomness>
rng
Option<&mut dyn RngCore>