Trait vb_accumulator::witness::Witness
source · pub trait Witness<G: AffineRepr> {
// Provided methods
fn compute_update_after_addition(
element: &G::ScalarField,
addition: &G::ScalarField,
old_witness: &G,
old_accumulator: &G
) -> (G::ScalarField, G) { ... }
fn compute_update_after_removal(
element: &G::ScalarField,
removal: &G::ScalarField,
old_witness: &G,
new_accumulator: &G
) -> Result<(G::ScalarField, G), VBAccumulatorError> { ... }
fn compute_update_using_secret_key_after_batch_additions(
additions: &[G::ScalarField],
elements: &[G::ScalarField],
old_witnesses: &[G],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError> { ... }
fn compute_update_using_secret_key_after_batch_removals(
removals: &[G::ScalarField],
elements: &[G::ScalarField],
old_witnesses: &[G],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError> { ... }
fn compute_update_using_secret_key_after_batch_updates(
additions: &[G::ScalarField],
removals: &[G::ScalarField],
elements: &[G::ScalarField],
old_witnesses: &[G],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError> { ... }
fn compute_update_using_public_info_after_batch_updates(
additions: &[G::ScalarField],
removals: &[G::ScalarField],
omega: &Omega<G>,
element: &G::ScalarField,
old_witness: &G
) -> Result<(G::ScalarField, G), VBAccumulatorError> { ... }
fn compute_update_using_public_info_after_multiple_batch_updates(
updates_and_omegas: Vec<(&[G::ScalarField], &[G::ScalarField], &Omega<G>)>,
element: &G::ScalarField,
old_witness: &G
) -> Result<(G::ScalarField, G), VBAccumulatorError> { ... }
fn compute_update_for_multiple_batches(
additions: Vec<&[G::ScalarField]>,
removals: Vec<&[G::ScalarField]>,
omegas: Vec<&Omega<G>>,
element: &G::ScalarField,
old_witness: &G
) -> Result<(G::ScalarField, G), VBAccumulatorError> { ... }
}
Expand description
Trait to hold common functionality among both membership and non-membership witnesses
Provided Methods§
sourcefn compute_update_after_addition(
element: &G::ScalarField,
addition: &G::ScalarField,
old_witness: &G,
old_accumulator: &G
) -> (G::ScalarField, G)
fn compute_update_after_addition( element: &G::ScalarField, addition: &G::ScalarField, old_witness: &G, old_accumulator: &G ) -> (G::ScalarField, G)
Compute an update to the witness after adding a single element in the accumulator. Expects the accumulator value before the addition. Described in section 2 of the paper
sourcefn compute_update_after_removal(
element: &G::ScalarField,
removal: &G::ScalarField,
old_witness: &G,
new_accumulator: &G
) -> Result<(G::ScalarField, G), VBAccumulatorError>
fn compute_update_after_removal( element: &G::ScalarField, removal: &G::ScalarField, old_witness: &G, new_accumulator: &G ) -> Result<(G::ScalarField, G), VBAccumulatorError>
Compute an update to the witness after removing a single element from the accumulator. Expects the accumulator value after the removal. Described in section 2 of the paper
sourcefn compute_update_using_secret_key_after_batch_additions(
additions: &[G::ScalarField],
elements: &[G::ScalarField],
old_witnesses: &[G],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError>
fn compute_update_using_secret_key_after_batch_additions( additions: &[G::ScalarField], elements: &[G::ScalarField], old_witnesses: &[G], old_accumulator: &G, sk: &SecretKey<G::ScalarField> ) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError>
Compute an update to several witnesses after adding a batch of elements in the accumulator. Expects the accumulator value before the addition and knowledge of the secret key. Intended to be used by the manager. Described in section 3 of the paper
sourcefn compute_update_using_secret_key_after_batch_removals(
removals: &[G::ScalarField],
elements: &[G::ScalarField],
old_witnesses: &[G],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError>
fn compute_update_using_secret_key_after_batch_removals( removals: &[G::ScalarField], elements: &[G::ScalarField], old_witnesses: &[G], old_accumulator: &G, sk: &SecretKey<G::ScalarField> ) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError>
Compute an update to several witnesses after removing a batch of elements from the accumulator. Expects the accumulator value after the removal and knowledge of the secret key. Intended to be used by the manager. Described in section 3 of the paper
sourcefn compute_update_using_secret_key_after_batch_updates(
additions: &[G::ScalarField],
removals: &[G::ScalarField],
elements: &[G::ScalarField],
old_witnesses: &[G],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError>
fn compute_update_using_secret_key_after_batch_updates( additions: &[G::ScalarField], removals: &[G::ScalarField], elements: &[G::ScalarField], old_witnesses: &[G], old_accumulator: &G, sk: &SecretKey<G::ScalarField> ) -> Result<(Vec<G::ScalarField>, Vec<G>), VBAccumulatorError>
Compute an update to several witnesses after adding and removing batches of elements from the accumulator. Expects the accumulator value before the update and knowledge of the secret key. Intended to be used by the manager. Described in section 3 of the paper
sourcefn compute_update_using_public_info_after_batch_updates(
additions: &[G::ScalarField],
removals: &[G::ScalarField],
omega: &Omega<G>,
element: &G::ScalarField,
old_witness: &G
) -> Result<(G::ScalarField, G), VBAccumulatorError>
fn compute_update_using_public_info_after_batch_updates( additions: &[G::ScalarField], removals: &[G::ScalarField], omega: &Omega<G>, element: &G::ScalarField, old_witness: &G ) -> Result<(G::ScalarField, G), VBAccumulatorError>
Compute an update to the witness after adding and removing batches of elements from the accumulator.
Expects the update-info (Omega
) published by the manager. Described in section 4.1 of the paper
sourcefn compute_update_using_public_info_after_multiple_batch_updates(
updates_and_omegas: Vec<(&[G::ScalarField], &[G::ScalarField], &Omega<G>)>,
element: &G::ScalarField,
old_witness: &G
) -> Result<(G::ScalarField, G), VBAccumulatorError>
fn compute_update_using_public_info_after_multiple_batch_updates( updates_and_omegas: Vec<(&[G::ScalarField], &[G::ScalarField], &Omega<G>)>, element: &G::ScalarField, old_witness: &G ) -> Result<(G::ScalarField, G), VBAccumulatorError>
Compute an update to the witness after adding and removing several batches of elements from the accumulator.
Expects the update-info (Omega
) published by the manager for each batch. Described in section 4.2 of the paper.