Struct plonkup::proof_system::Prover
source · [−]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
Proof
s 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
sourceimpl Prover
impl Prover
sourcepub fn composer_mut(&mut self) -> &mut TurboComposer
pub fn composer_mut(&mut self) -> &mut TurboComposer
Mutable borrow of TurboComposer
.
sourceimpl 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) -> usize
pub const fn gates(&self) -> usize
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<R: RngCore + CryptoRng>(
&self,
commit_key: &CommitKey,
prover_key: &ProverKey,
rng: &mut R
) -> Result<Proof, Error>
pub fn prove_with_preprocessed<R: RngCore + CryptoRng>(
&self,
commit_key: &CommitKey,
prover_key: &ProverKey,
rng: &mut R
) -> Result<Proof, Error>
Creates a [Proof]
that demonstrates that a circuit is satisfied.
Note
If you intend to construct multiple Proof
s 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 RefUnwindSafe for Prover
impl Send for Prover
impl Sync for Prover
impl Unpin for Prover
impl UnwindSafe for Prover
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more