Trait acvm::ProofSystemCompiler
source · pub trait ProofSystemCompiler {
// Required methods
fn np_language(&self) -> Language;
fn black_box_function_supported(&self, opcode: &BlackBoxFunc) -> bool;
fn get_exact_circuit_size(&self, circuit: &Circuit) -> u32;
fn preprocess(&self, circuit: &Circuit) -> (Vec<u8>, Vec<u8>);
fn prove_with_pk(
&self,
circuit: &Circuit,
witness_values: BTreeMap<Witness, FieldElement>,
proving_key: &[u8]
) -> Vec<u8>;
fn verify_with_vk(
&self,
proof: &[u8],
public_inputs: BTreeMap<Witness, FieldElement>,
circuit: &Circuit,
verification_key: &[u8]
) -> bool;
}
Required Methods§
sourcefn np_language(&self) -> Language
fn np_language(&self) -> Language
The NPC language that this proof system directly accepts. It is possible for ACVM to transpile to different languages, however it is advised to create a new backend as this in most cases will be inefficient. For this reason, we want to throw a hard error if the language and proof system does not line up.
fn black_box_function_supported(&self, opcode: &BlackBoxFunc) -> bool
sourcefn get_exact_circuit_size(&self, circuit: &Circuit) -> u32
fn get_exact_circuit_size(&self, circuit: &Circuit) -> u32
Returns the number of gates in a circuit
sourcefn preprocess(&self, circuit: &Circuit) -> (Vec<u8>, Vec<u8>)
fn preprocess(&self, circuit: &Circuit) -> (Vec<u8>, Vec<u8>)
Generates a proving and verification key given the circuit description These keys can then be used to construct a proof and for its verification
sourcefn prove_with_pk(
&self,
circuit: &Circuit,
witness_values: BTreeMap<Witness, FieldElement>,
proving_key: &[u8]
) -> Vec<u8>
fn prove_with_pk( &self, circuit: &Circuit, witness_values: BTreeMap<Witness, FieldElement>, proving_key: &[u8] ) -> Vec<u8>
Creates a Proof given the circuit description, the initial witness values, and the proving key It is important to note that the intermediate witnesses for black box functions will not generated This is the responsibility of the proof system.
sourcefn verify_with_vk(
&self,
proof: &[u8],
public_inputs: BTreeMap<Witness, FieldElement>,
circuit: &Circuit,
verification_key: &[u8]
) -> bool
fn verify_with_vk( &self, proof: &[u8], public_inputs: BTreeMap<Witness, FieldElement>, circuit: &Circuit, verification_key: &[u8] ) -> bool
Verifies a Proof, given the circuit description, the circuit’s public inputs, and the verification key