Struct vb_accumulator::batch_utils::Omega
source · pub struct Omega<G: AffineRepr>(pub Vec<G>);
Expand description
Published by the accumulator manager to allow witness updates without secret info. This “represents” a polynomial which will be evaluated at the element whose witness needs to be updated. Defined in section 4.1 of the paper
Tuple Fields§
§0: Vec<G>
Implementations§
source§impl<G> Omega<G>where
G: AffineRepr,
impl<G> Omega<G>where
G: AffineRepr,
sourcepub fn new(
additions: &[G::ScalarField],
removals: &[G::ScalarField],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Self
pub fn new( additions: &[G::ScalarField], removals: &[G::ScalarField], old_accumulator: &G, sk: &SecretKey<G::ScalarField> ) -> Self
Create new Omega
after additions
are added and removals
are removed from old_accumulator
.
Note that old_accumulator
is the accumulated value before the updates were made.
Returns c_0 * V, c_1 * V, ..., c_n * V
where V
is the accumulator before the update and c_i
are the coefficients of
the polynomial v_AD
sourcepub fn new_for_kb_positive_accumulator<D: Default + DynDigest + Clone>(
removals: &[G::ScalarField],
old_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> Self
pub fn new_for_kb_positive_accumulator<D: Default + DynDigest + Clone>( removals: &[G::ScalarField], old_accumulator: &G, sk: &SecretKey<G::ScalarField> ) -> Self
Create Omega
for KB positive accumulator after removals
are removed from old_accumulator
.
Returns c_0 * -V, c_1 * -V, ..., c_n * -V
where V
is the accumulator before the update and c_i
are the coefficients of
the polynomial v_D
. As this accumulator does not change on additions, only polynomial v_D
is generated.
sourcepub fn new_for_kb_universal_accumulator(
additions: &[G::ScalarField],
removals: &[G::ScalarField],
old_mem_accumulator: &G,
old_non_mem_accumulator: &G,
sk: &SecretKey<G::ScalarField>
) -> (Self, Self)
pub fn new_for_kb_universal_accumulator( additions: &[G::ScalarField], removals: &[G::ScalarField], old_mem_accumulator: &G, old_non_mem_accumulator: &G, sk: &SecretKey<G::ScalarField> ) -> (Self, Self)
Create 2 Omega
s for KB universal accumulator. As this accumulator comprises of 2 positive accumulators, this
returns 2 Omega
s, one for each of those accumulators
sourcepub fn inner_product_with_scaled_powers_of_y(
&self,
y: &G::ScalarField,
scalar: &G::ScalarField
) -> G::Group
pub fn inner_product_with_scaled_powers_of_y( &self, y: &G::ScalarField, scalar: &G::ScalarField ) -> G::Group
Inner product of powers of y
, i.e. the element for which witness needs to be updated and omega
.
Equivalent to evaluating the polynomial at y
and multiplying the result by scalar
Used by the (non)member to update its witness without the knowledge of secret key.
pub fn inner_product_with_scaled_powers_of_y_temp( &self, y: &G::ScalarField, scalar: &G::ScalarField ) -> G::Group
sourcepub fn scaled_powers_of_y(
y: &G::ScalarField,
scalar: &G::ScalarField,
n: usize
) -> Vec<G::ScalarField>
pub fn scaled_powers_of_y( y: &G::ScalarField, scalar: &G::ScalarField, n: usize ) -> Vec<G::ScalarField>
Return [scalar
1, scalar
y
, scalar
y^2
, scalar
y^3
, …, scalar
*y^{n-1}
]
sourcepub fn scaled(&self, scalar: &G::ScalarField) -> Vec<G::Group>
pub fn scaled(&self, scalar: &G::ScalarField) -> Vec<G::Group>
Scale the omega vector by the given scalar
pub fn len(&self) -> usize
sourcepub fn coefficient(&self, i: usize) -> &G
pub fn coefficient(&self, i: usize) -> &G
Coefficient (c_i
) at the ith position