Removing a batch of members from the accumulator. Reads and writes to state. Described in section 3 of the paper
(
&self,
elements: &[G::ScalarField],
sk: &SecretKey<G::ScalarField>,
initial_elements_store: &dyn InitialElementsStore<G::ScalarField>,
state: &mut dyn State<G
| 348 | |
| 349 | /// Removing a batch of members from the accumulator. Reads and writes to state. Described in section 3 of the paper |
| 350 | pub fn remove_batch( |
| 351 | &self, |
| 352 | elements: &[G::ScalarField], |
| 353 | sk: &SecretKey<G::ScalarField>, |
| 354 | initial_elements_store: &dyn InitialElementsStore<G::ScalarField>, |
| 355 | state: &mut dyn State<G::ScalarField>, |
| 356 | ) -> Result<Self, VBAccumulatorError> { |
| 357 | for element in elements.iter() { |
| 358 | if !self.is_element_acceptable(element, initial_elements_store) { |
| 359 | return Err(VBAccumulatorError::ProhibitedElement); |
| 360 | } |
| 361 | } |
| 362 | let (mut d_alpha_inv, V) = self._remove_batch(elements, sk, state)?; |
| 363 | let f_V = d_alpha_inv * self.f_V; |
| 364 | d_alpha_inv.zeroize(); |
| 365 | Ok(self.get_updated(f_V, V)) |
| 366 | } |
| 367 | |
| 368 | /// Compute new accumulated value after batch additions and removals |
| 369 | pub fn compute_new_post_batch_updates( |