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§

source

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.

source

fn black_box_function_supported(&self, opcode: &BlackBoxFunc) -> bool

source

fn get_exact_circuit_size(&self, circuit: &Circuit) -> u32

Returns the number of gates in a circuit

source

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

source

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.

source

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

Implementors§