[][src]Struct zkp::toolbox::batch_verifier::BatchVerifier

pub struct BatchVerifier<'a> { /* fields omitted */ }

Used to produce batch verification results.

To use a BatchVerifier, first construct one using BatchVerifier::new(), declaring a batch size, supplying a domain separation label for the proof statement, as well as a transcript for each proof to verify.

Allocate secret variables using BatchVerifier::allocate_scalar.

To allocate points which have the same assignment for all proofs in the batch, use BatchVerifier::allocate_static_point. This allows the implementation to overlap coefficients among all proofs in the combined verification check.

To allocate points which have different asssignments for each proof instance, use BatchVerifier::allocate_instance_point.

Finally, use BatchVerifier::verify_batchable to consume the verifier and produce a batch verification result.

Methods

impl<'a> BatchVerifier<'a>[src]

pub fn new(
    proof_label: &'static [u8],
    batch_size: usize,
    transcripts: Vec<&'a mut Transcript>
) -> Result<Self, ProofError>
[src]

Construct a new batch verifier for the statement with the given proof_label.

The batch_size is required as an up-front parameter to help prevent errors with size mismatches.

Note that this function requires one transcript borrow per proof.

pub fn allocate_scalar(&mut self, label: &'static [u8]) -> ScalarVar[src]

Allocate a placeholder scalar variable with the given label.

pub fn allocate_static_point(
    &mut self,
    label: &'static [u8],
    assignment: CompressedRistretto
) -> Result<PointVar, ProofError>
[src]

Allocate a point variable whose assignment is common to all proofs in the batch.

pub fn allocate_instance_point(
    &mut self,
    label: &'static [u8],
    assignments: Vec<CompressedRistretto>
) -> Result<PointVar, ProofError>
[src]

Allocate a point variable with a different assignment for each proof instance.

pub fn verify_batchable(
    self,
    proofs: &[BatchableProof]
) -> Result<(), ProofError>
[src]

Consume the verifier to produce a verification result.

Trait Implementations

impl<'a> SchnorrCS for BatchVerifier<'a>[src]

type ScalarVar = ScalarVar

A handle for a scalar variable in the constraint system.

type PointVar = PointVar

A handle for a point variable in the constraint system.

Auto Trait Implementations

impl<'a> RefUnwindSafe for BatchVerifier<'a>

impl<'a> Send for BatchVerifier<'a>

impl<'a> Sync for BatchVerifier<'a>

impl<'a> Unpin for BatchVerifier<'a>

impl<'a> !UnwindSafe for BatchVerifier<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,