[−][src]Struct zkp::toolbox::prover::Prover
Used to create proofs.
To use a Prover
, first construct one using Prover::new()
,
supplying a domain separation label, as well as the transcript to
operate on.
Then, allocate and assign secret (Prover::allocate_scalar
) and
public (Prover::allocate_point
) variables, and use those
variables to define the proof statements.
Finally, use Prover::prove_compact
or
Prover::prove_batchable
to consume the prover and produce a
proof.
Fields
transcript: &'a mut Transcript
scalars: Vec<Scalar>
points: Vec<RistrettoPoint>
point_labels: Vec<&'static [u8]>
constraints: Vec<(PointVar, Vec<(ScalarVar, PointVar)>)>
Methods
impl<'a> Prover<'a>
[src]
pub fn new(proof_label: &'static [u8], transcript: &'a mut Transcript) -> Self
[src]
Construct a new prover. The proof_label
disambiguates proof
statements.
pub fn allocate_scalar(
&mut self,
label: &'static [u8],
assignment: Scalar
) -> ScalarVar
[src]
&mut self,
label: &'static [u8],
assignment: Scalar
) -> ScalarVar
Allocate and assign a secret variable with the given label
.
pub fn allocate_point(
&mut self,
label: &'static [u8],
assignment: RistrettoPoint
) -> (PointVar, CompressedRistretto)
[src]
&mut self,
label: &'static [u8],
assignment: RistrettoPoint
) -> (PointVar, CompressedRistretto)
Allocate and assign a public variable with the given label
.
The point is compressed to be appended to the transcript, and the compressed point is returned to allow reusing the result of that computation; it can be safely discarded.
fn prove_impl(self) -> (Scalar, Vec<Scalar>, Vec<CompressedRistretto>)
[src]
The compact and batchable proofs differ only by which data they store.
pub fn prove_compact(self) -> CompactProof
[src]
Consume this prover to produce a compact proof.
pub fn prove_batchable(self) -> BatchableProof
[src]
Consume this prover to produce a batchable proof.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Prover<'a>
impl<'a> Send for Prover<'a>
impl<'a> Sync for Prover<'a>
impl<'a> Unpin for Prover<'a>
impl<'a> !UnwindSafe for Prover<'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>,