[−][src]Struct zkp::toolbox::verifier::Verifier
Used to produce verification results.
To use a Verifier
, first construct one using Verifier::new()
,
supplying a domain separation label, as well as the transcript to
operate on.
Then, allocate secret (Verifier::allocate_scalar
) variables
and allocate and assign public (Verifier::allocate_point
)
variables, and use those variables to define the proof statements.
Note that no assignments to secret variables are assigned, since
the verifier doesn't know the secrets.
Finally, use Verifier::verify_compact
or
Verifier::verify_batchable
to consume the verifier and produce
a verification result.
Fields
transcript: &'a mut Transcript
num_scalars: usize
points: Vec<CompressedRistretto>
point_labels: Vec<&'static [u8]>
constraints: Vec<(PointVar, Vec<(ScalarVar, PointVar)>)>
Methods
impl<'a> Verifier<'a>
[src]
pub fn new(proof_label: &'static [u8], transcript: &'a mut Transcript) -> Self
[src]
Construct a verifier for the proof statement with the given
proof_label
, operating on the given transcript
.
pub fn allocate_scalar(&mut self, label: &'static [u8]) -> ScalarVar
[src]
Allocate a placeholder scalar variable, without an assignment.
pub fn allocate_point(
&mut self,
label: &'static [u8],
assignment: CompressedRistretto
) -> Result<PointVar, ProofError>
[src]
&mut self,
label: &'static [u8],
assignment: CompressedRistretto
) -> Result<PointVar, ProofError>
Attempt to allocate a point variable, or fail verification if the assignment is invalid.
pub fn verify_compact(self, proof: &CompactProof) -> Result<(), ProofError>
[src]
Consume the verifier to produce a verification of a CompactProof
.
pub fn verify_batchable(self, proof: &BatchableProof) -> Result<(), ProofError>
[src]
Consume the verifier to produce a verification of a BatchableProof
.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Verifier<'a>
impl<'a> Send for Verifier<'a>
impl<'a> Sync for Verifier<'a>
impl<'a> Unpin for Verifier<'a>
impl<'a> !UnwindSafe for Verifier<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = !
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, U> TryInto<U> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,