in prover/src/lib.rs [139:189]
fn get_pub_inputs(&self, trace: &Self::Trace) -> <<Self as Prover>::Air as Air>::PublicInputs;
/// Returns [ProofOptions] which this prover uses to generate STARK proofs.
///
/// Proof options defines basic protocol parameters such as: number of queries, blowup factor,
/// grinding factor, hash function to be used in the protocol etc. These properties directly
/// inform such metrics as proof generation time, proof size, and proof security level.
fn options(&self) -> &ProofOptions;
// PROVIDED METHODS
// --------------------------------------------------------------------------------------------
/// Returns a STARK proof attesting to a correct execution of a computation defined by the
/// provided trace.
///
/// The returned [StarkProof] attests that the specified `trace` is a valid execution trace of
/// the computation described by [Self::Air](Prover::Air) and generated using some set of
/// secret and public inputs. Public inputs must match the value returned from
/// [Self::get_pub_inputs()](Prover::get_pub_inputs) for the provided trace.
#[rustfmt::skip]
fn prove(&self, trace: Self::Trace) -> Result<StarkProof, ProverError> {
// figure out which version of the generic proof generation procedure to run. this is a sort
// of static dispatch for selecting two generic parameter: extension field and hash function.
match self.options().field_extension() {
FieldExtension::None => match self.options().hash_fn() {
HashFunction::Blake3_256 => self.generate_proof::<Self::BaseField, Blake3_256<Self::BaseField>>(trace),
HashFunction::Blake3_192 => self.generate_proof::<Self::BaseField, Blake3_192<Self::BaseField>>(trace),
HashFunction::Sha3_256 => self.generate_proof::<Self::BaseField, Sha3_256<Self::BaseField>>(trace),
},
FieldExtension::Quadratic => {
if !<QuadExtension<Self::BaseField>>::is_supported() {
return Err(ProverError::UnsupportedFieldExtension(2));
}
match self.options().hash_fn() {
HashFunction::Blake3_256 => self.generate_proof::<QuadExtension<Self::BaseField>, Blake3_256<Self::BaseField>>(trace),
HashFunction::Blake3_192 => self.generate_proof::<QuadExtension<Self::BaseField>, Blake3_192<Self::BaseField>>(trace),
HashFunction::Sha3_256 => self.generate_proof::<QuadExtension<Self::BaseField>, Sha3_256<Self::BaseField>>(trace),
}
}
FieldExtension::Cubic => {
if !<CubeExtension<Self::BaseField>>::is_supported() {
return Err(ProverError::UnsupportedFieldExtension(3));
}
match self.options().hash_fn() {
HashFunction::Blake3_256 => self.generate_proof::<CubeExtension<Self::BaseField>, Blake3_256<Self::BaseField>>(trace),
HashFunction::Blake3_192 => self.generate_proof::<CubeExtension<Self::BaseField>, Blake3_192<Self::BaseField>>(trace),
HashFunction::Sha3_256 => self.generate_proof::<CubeExtension<Self::BaseField>, Sha3_256<Self::BaseField>>(trace),
}
}
}
}