[−][src]Struct accumulator::VectorCommitment
A vector commitment, wrapping an underlying accumulator. The accumulator contains indices of an abstract vector where the corresponding bit is True.
Methods
impl<G: UnknownOrderGroup> VectorCommitment<G>
[src]
pub fn empty() -> Self
[src]
Initializes a new vector commitment (VC).
pub fn update(
vc: Self,
vc_acc_set: &[Integer],
bits: &[(bool, Integer)]
) -> Result<(Self, VectorProof<G>), VCError>
[src]
vc: Self,
vc_acc_set: &[Integer],
bits: &[(bool, Integer)]
) -> Result<(Self, VectorProof<G>), VCError>
Updates a VC with a list of values and indices.
Arguments
vc_acc_set
- All indices that are set (True).bits
- Tuples (truth value, bit index) to set.
Uses a move instead of a &self
reference to prevent accidental use of the old VC state.
pub fn open(
vc: &Self,
vc_acc_set: &[Integer],
zero_bits: &[Integer],
one_bit_witnesses: &[(Integer, Witness<G, Integer>)]
) -> Result<VectorProof<G>, VCError>
[src]
vc: &Self,
vc_acc_set: &[Integer],
zero_bits: &[Integer],
one_bit_witnesses: &[(Integer, Witness<G, Integer>)]
) -> Result<VectorProof<G>, VCError>
Opens/generates a commitment to indices in the VC.
Arguments
vc_acc_set
- All indices that are set (True).zero_bits
- Indices you want to prove are unset (False).one_bit_witnesses
- Indices you want to prove are set (True) and their witnesses.
pub fn verify(
vc: &Self,
bits: &[(bool, Integer)],
VectorProof { membership_proof: membership_proof, nonmembership_proof: nonmembership_proof }: &VectorProof<G>
) -> bool
[src]
vc: &Self,
bits: &[(bool, Integer)],
VectorProof { membership_proof: membership_proof, nonmembership_proof: nonmembership_proof }: &VectorProof<G>
) -> bool
Verifies a commitment to indices in the VC.
Arguments
bits
- Tuples (truth value, bit index) to verify.VectorProof
- AVectorProof
to verify against.
Trait Implementations
impl<G: Eq + UnknownOrderGroup> Eq for VectorCommitment<G>
[src]
impl<G: PartialEq + UnknownOrderGroup> PartialEq<VectorCommitment<G>> for VectorCommitment<G>
[src]
fn eq(&self, other: &VectorCommitment<G>) -> bool
[src]
fn ne(&self, other: &VectorCommitment<G>) -> bool
[src]
impl<G: Clone + UnknownOrderGroup> Clone for VectorCommitment<G>
[src]
fn clone(&self) -> VectorCommitment<G>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<G: Debug + UnknownOrderGroup> Debug for VectorCommitment<G>
[src]
impl<G: Hash + UnknownOrderGroup> Hash for VectorCommitment<G>
[src]
Auto Trait Implementations
impl<G> Send for VectorCommitment<G> where
<G as Group>::Elem: Send,
<G as Group>::Elem: Send,
impl<G> Sync for VectorCommitment<G> where
<G as Group>::Elem: Sync,
<G as Group>::Elem: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self