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. Its a binding but non-hiding commitment to the polynomial. 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 evaluate(&self, y: &G::ScalarField, scalar: &G::ScalarField) -> G::Group
pub fn evaluate(&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.
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
pub fn from(coeffs: Vec<G>) -> Self
Trait Implementations§
Source§impl<G: AffineRepr> CanonicalDeserialize for Omega<G>
impl<G: AffineRepr> CanonicalDeserialize for Omega<G>
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
Source§impl<G: AffineRepr> CanonicalSerialize for Omega<G>
impl<G: AffineRepr> CanonicalSerialize for Omega<G>
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
Source§impl<'de, G: AffineRepr> Deserialize<'de> for Omega<G>
impl<'de, G: AffineRepr> Deserialize<'de> for Omega<G>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<G: AffineRepr> Serialize for Omega<G>
impl<G: AffineRepr> Serialize for Omega<G>
Source§impl<G: AffineRepr> Valid for Omega<G>
impl<G: AffineRepr> Valid for Omega<G>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
impl<G: Eq + AffineRepr> Eq for Omega<G>
impl<G: AffineRepr> StructuralPartialEq for Omega<G>
Auto Trait Implementations§
impl<G> Freeze for Omega<G>
impl<G> RefUnwindSafe for Omega<G>where
G: RefUnwindSafe,
impl<G> Send for Omega<G>
impl<G> Sync for Omega<G>
impl<G> Unpin for Omega<G>where
G: Unpin,
impl<G> UnwindSafe for Omega<G>where
G: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
fn hash_uncompressed<H>(
&self,
) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more