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

Method is_element_acceptable

vb_accumulator/src/universal.rs:221–227  ·  view source on GitHub ↗

TODO: What is an attacker figures out a way to keep on querying the accumulator manager for acceptable elements. Like submitting add or remove requests and keeping track of when errors were returned or requesting witness for elements. In practice this would be a cost to an attacker but still something to be aware of. Check if element is part of the initial elements. Such elements should not be add

(
        &self,
        element: &G::ScalarField,
        initial_elements_store: &dyn InitialElementsStore<G::ScalarField>,
    )

Source from the content-addressed store, hash-verified

219 // In practice this would be a cost to an attacker but still something to be aware of.
220 /// Check if element is part of the initial elements. Such elements should not be added or removed from the accumulator
221 pub fn is_element_acceptable(
222 &self,
223 element: &G::ScalarField,
224 initial_elements_store: &dyn InitialElementsStore<G::ScalarField>,
225 ) -> bool {
226 !initial_elements_store.has(element)
227 }
228
229 /// Update the accumulated values with the given ones
230 pub fn get_updated(&self, f_V: G::ScalarField, V: G) -> Self {

Callers 5

addMethod · 0.80
add_batchMethod · 0.80
removeMethod · 0.80
remove_batchMethod · 0.80
batch_updatesMethod · 0.80

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected