MCPcopy Create free account
hub / github.com/docknetwork/crypto / remove_batch

Method remove_batch

vb_accumulator/src/universal.rs:350–366  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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(

Callers 1

Calls 5

is_element_acceptableMethod · 0.80
_remove_batchMethod · 0.80
get_updatedMethod · 0.80
iterMethod · 0.45
zeroizeMethod · 0.45

Tested by 1