pub struct Prover {
pub prover_key: Option<ProverKey>,
pub preprocessed_transcript: Transcript,
/* private fields */
}Expand description
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: TranscriptStore the messages exchanged during the preprocessing stage This is copied each time, we make a proof
Implementations§
Source§impl Prover
impl Prover
Sourcepub fn composer_mut(&mut self) -> &mut TurboComposer
pub fn composer_mut(&mut self) -> &mut TurboComposer
Mutable borrow of TurboComposer.
Source§impl Prover
impl Prover
Sourcepub fn with_size(label: &'static [u8], size: usize) -> Prover
pub fn with_size(label: &'static [u8], size: usize) -> Prover
Creates a new Prover object with some expected size.
Sourcepub const fn gates(&self) -> u32
pub const fn gates(&self) -> u32
Returns the number of gates in the circuit thet the Prover actually
stores inside.
Sourcepub fn clear_witness(&mut self)
pub fn clear_witness(&mut self)
Resets the witnesses in the prover object. This function is used when the user wants to make multiple proofs with the same circuit.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
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.
Sourcepub fn key_transcript(&mut self, label: &'static [u8], message: &[u8])
pub fn key_transcript(&mut self, label: &'static [u8], message: &[u8])
Keys the Transcript with additional seed information
Wrapper around Transcript::append_message.
Sourcepub fn prove_with_preprocessed(
&self,
commit_key: &CommitKey,
prover_key: &ProverKey,
) -> Result<Proof, Error>
pub fn prove_with_preprocessed( &self, commit_key: &CommitKey, prover_key: &ProverKey, ) -> Result<Proof, Error>
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prover
impl RefUnwindSafe for Prover
impl Send for Prover
impl Sync for Prover
impl Unpin for Prover
impl UnwindSafe for Prover
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more