pub fn perform_updates<
        EFqSponge: Clone + FqSponge<Other::BaseField, Other, Other::ScalarField>,
        EFrSponge: FrSponge<Other::ScalarField>,
    >(
        &self,
        mut reqs: Vec<UpdateRequest<G, Other>>,
    ) -> Vec<Result<UpdateResponse<G>, &str>> {
        let mut results = vec![Err(""); reqs.len()];

        let mut batch_indices = vec![];
        let mut batch = vec![];
        for (i, req) in reqs.iter_mut().enumerate() {
            match req.randomized_acc.to_coordinates() {
                None => results[i] = Err("Invalid accumulator in request"),
                Some((x, y)) => {
                    req.proof.public = vec![x, y];
                    batch_indices.push(i);
                    batch.push((&self.update_vk, &self.other_lgr_comms, &req.proof))
                }
            }
        }

        let mut success_indices = vec![];
        let verify_results = batch_verify_proofs::<_, EFqSponge, EFrSponge>(&self.group_map, batch);
        for (&i, verified) in batch_indices.iter().zip(verify_results) {
            if verified {
                success_indices.push(i);
            } else {
                results[i] = Err("Update proof failed to verify");
            }
        }

        for i in success_indices {
            let req = &reqs[i];

            let delta = update_delta(&self.lgr_comms[..], &req.updates[..]);

            let new_acc = delta.add_mixed(&req.randomized_acc).into_affine();

            results[i] = Ok(UpdateResponse::<G> {
                signature: self.signer.sign(self.signing_key, new_acc),
            });
        }

        results
    }
// This function is batched for efficiency of proof verification
This function is batched for efficiency of proof verification
This function is batched for efficiency of proof verification
pub fn perform_updates<
        EFqSponge: Clone + FqSponge<Other::BaseField, Other, Other::ScalarField>,
        EFrSponge: FrSponge<Other::ScalarField>,
    >(
        &self,
        mut reqs: Vec<UpdateRequest<G, Other>>,
    ) -> Vec<Result<UpdateResponse<G>, &str>> {
        let mut results = vec![Err(""); reqs.len()];
        let mut batch_indices = vec![];
        let mut batch = vec![];
        for (i, req) in reqs.iter_mut().enumerate() {
            match req.randomized_acc.to_coordinates() {
                None => results[i] = Err("Invalid accumulator in request"),
                Some((x, y)) => {
                    req.proof.public = vec![x, y];
                    batch_indices.push(i);
                    batch.push((&self.update_vk, &self.other_lgr_comms, &req.proof))
                }
            }
        }
        let mut success_indices = vec![];
        let verify_results = batch_verify_proofs::<_, EFqSponge, EFrSponge>(&self.group_map, batch);
        for (&i, verified) in batch_indices.iter().zip(verify_results) {
            if verified {
                success_indices.push(i);
            } else {
                results[i] = Err("Update proof failed to verify");
            }
        }
        for i in success_indices {
            let req = &reqs[i];
            let delta = update_delta(&self.lgr_comms[..], &req.updates[..]);
            let new_acc = delta.add_mixed(&req.randomized_acc).into_affine();
            results[i] = Ok(UpdateResponse::<G> {
                signature: self.signer.sign(self.signing_key, new_acc),
            });
        }
        results
    }
pub fn perform_updates < EFqSponge : Clone + FqSponge < Other :: BaseField , Other , Other :: ScalarField > , EFrSponge : FrSponge < Other :: ScalarField > , > ( & self , mut reqs : Vec < UpdateRequest < G , Other > > , ) -> Vec < Result < UpdateResponse < G > , & str > > { let mut results = vec ! [ Err ( " " ) reqs len ( ) ] ; let mut batch_indices = vec ! [ ] ; let mut batch = vec ! [ ] ; for ( i , req ) in reqs . iter_mut ( ) . enumerate ( ) { match req . randomized_acc . to_coordinates ( ) { None => results [ i ] = Err ( " " ) , Some ( ( x , y ) ) => { req . proof . public = vec ! [ x y ] ; batch_indices . push ( i ) ; batch . push ( ( & self . update_vk , & self . other_lgr_comms , & req . proof ) ) } } } let mut success_indices = vec ! [ ] ; let verify_results = batch_verify_proofs :: < _ , EFqSponge , EFrSponge > ( & self . group_map , batch ) ; for ( & i , verified ) in batch_indices . iter ( ) . zip ( verify_results ) { if verified { success_indices . push ( i ) ; } else { results [ i ] = Err ( " " ) ; } } for i in success_indices { let req = & reqs [ i ] ; let delta = update_delta ( & self . lgr_comms [ .. ] , & req . updates [ .. ] ) ; let new_acc = delta . add_mixed ( & req . randomized_acc ) . into_affine ( ) ; results [ i ] = Ok ( UpdateResponse :: < G > { signature : self . signer . sign ( self . signing_key , new_acc ) , } ) ; } results }
This function is batched for efficiency of proof verification
This function is batched for efficiency of proof verification
&self
reqs
Vec<UpdateRequest<G, Other>>