[][src]Struct bulletproofs::r1cs::Verifier

pub struct Verifier<'t> { /* fields omitted */ }

A ConstraintSystem implementation for use by the verifier.

The verifier adds high-level variable commitments to the transcript, allocates low-level variables and creates constraints in terms of these high-level variables and low-level variables.

When all constraints are added, the verifying code calls verify which consumes the Verifier instance, samples random challenges that instantiate the randomized constraints, and verifies the proof.

Methods

impl<'t> Verifier<'t>[src]

pub fn new(transcript: &'t mut Transcript) -> Self[src]

Construct an empty constraint system with specified external input variables.

Inputs

The transcript parameter is a Merlin proof transcript. The VerifierCS holds onto the &mut Transcript until it consumes itself during [VerifierCS::verify], releasing its borrow of the transcript. This ensures that the transcript cannot be altered except by the VerifierCS before proving is complete.

The commitments parameter is a list of Pedersen commitments to the external variables for the constraint system. All external variables must be passed up-front, so that challenges produced by [ConstraintSystem::challenge_scalar] are bound to the external variables.

Returns

Returns a tuple (cs, vars).

The first element is the newly constructed constraint system.

The second element is a list of Variables corresponding to the external inputs, which can be used to form constraints.

pub fn commit(&mut self, commitment: CompressedRistretto) -> Variable[src]

Creates commitment to a high-level variable and adds it to the transcript.

Inputs

The commitment parameter is a Pedersen commitment to the external variable for the constraint system. All external variables must be passed up-front, so that challenges produced by [ConstraintSystem::challenge_scalar] are bound to the external variables.

Returns

Returns a pair of a Pedersen commitment (as a compressed Ristretto point), and a Variable corresponding to it, which can be used to form constraints.

pub fn verify(
    self,
    proof: &R1CSProof,
    pc_gens: &PedersenGens,
    bp_gens: &BulletproofGens
) -> Result<(), R1CSError>
[src]

Consume this VerifierCS and attempt to verify the supplied proof. The pc_gens and bp_gens are generators for Pedersen commitments and Bulletproofs vector commitments, respectively. The BulletproofGens should have gens_capacity greater than the number of multiplication constraints that will eventually be added into the constraint system.

Trait Implementations

impl<'t> ConstraintSystem for Verifier<'t>[src]

impl<'t> RandomizableConstraintSystem for Verifier<'t>[src]

type RandomizedCS = RandomizingVerifier<'t>

Represents a concrete type for the CS in a randomization phase.

Auto Trait Implementations

impl<'t> !Send for Verifier<'t>

impl<'t> !Sync for Verifier<'t>

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Same for T

type Output = T

Should always be Self