Struct dusk_plonk::proof_system::prover::Prover[][src]

pub struct Prover {
    pub prover_key: Option<ProverKey>,
    pub preprocessed_transcript: Transcript,
    // some fields omitted
}

Abstraction structure designed to construct a circuit and generate Proofs for it.

Fields

prover_key: Option<ProverKey>

ProverKey which is used to create proofs about a specific PLONK circuit

preprocessed_transcript: Transcript

Store the messages exchanged during the preprocessing stage This is copied each time, we make a proof

Implementations

impl Prover[src]

pub fn mut_cs(&mut self) -> &mut StandardComposer[src]

Returns a mutable copy of the underlying StandardComposer.

pub fn preprocess(&mut self, commit_key: &CommitKey) -> Result<(), Error>[src]

Preprocesses the underlying constraint system.

impl Prover[src]

pub fn new(label: &'static [u8]) -> Prover[src]

Creates a new Prover instance.

pub fn with_expected_size(label: &'static [u8], size: usize) -> Prover[src]

Creates a new Prover object with some expected size.

pub fn circuit_size(&self) -> usize[src]

Returns the number of gates in the circuit thet the Prover actually stores inside.

pub fn clear_witness(&mut self)[src]

Resets the witnesses in the prover object. This function is used when the user wants to make multiple proofs with the same circuit.

pub fn clear(&mut self)[src]

Clears all data in the Prover instance. This function is used when the user wants to use the same Prover to make a Proof regarding a different circuit.

pub fn key_transcript(&mut self, label: &'static [u8], message: &[u8])[src]

Keys the Transcript with additional seed information Wrapper around Transcript::append_message.

pub fn prove_with_preprocessed(
    &self,
    commit_key: &CommitKey,
    prover_key: &ProverKey
) -> Result<Proof, Error>
[src]

Creates a [Proof] that demonstrates that a circuit is satisfied.

Note

If you intend to construct multiple Proofs with different witnesses, after calling this method, the user should then call Prover::clear_witness. This is automatically done when Prover::prove is called.

pub fn prove(&mut self, commit_key: &CommitKey) -> Result<Proof, Error>[src]

Proves a circuit is satisfied, then clears the witness variables If the circuit is not pre-processed, then the preprocessed circuit will also be computed.

Trait Implementations

impl Default for Prover[src]

Auto Trait Implementations

impl RefUnwindSafe for Prover

impl Send for Prover

impl Sync for Prover

impl Unpin for Prover

impl UnwindSafe for Prover

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> Pointable for T

type Init = T

The type for initializers.

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

type Error = Infallible

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.