[][src]Struct accumulator::VectorCommitment

pub struct VectorCommitment<G: UnknownOrderGroup>(_);

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]

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]

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]

Verifies a commitment to indices in the VC.

Arguments

  • bits - Tuples (truth value, bit index) to verify.
  • VectorProof - A VectorProof 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]

impl<G: Clone + UnknownOrderGroup> Clone for 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]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<G> Send for VectorCommitment<G> where
    <G as Group>::Elem: Send

impl<G> Sync for VectorCommitment<G> where
    <G as Group>::Elem: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self