Module helpers

Module helpers 

Source
Expand description

Includes boilerplate for creating a GKR circuit, i.e. creating a transcript, proving, verifying, etc.

Functionsยง

get_circuit_description_hash_as_field_elems
Returns an equivalent set of field elements to be absorbed into a transcript, given a circuit description and the type of hash function to be used.
prove_circuit_internal ๐Ÿ”’
Generates a GKR proof (in the form of a [TranscriptReader<F, Tr>]) and a [ProofConfig] (to be used in verification) for the given ProvableCircuit<F>.
prove_circuit_with_runtime_optimized_config
Wrapper around prove_circuit_internal() which uses a runtime-optimized prover config.
test_circuit_internal ๐Ÿ”’
Function which instantiates a circuit description with the given inputs and precommits and both attempts to both prove and verify said circuit.
test_circuit_with_config
Function which calls test_circuit_internal with the appropriate expected prover/verifier config.
test_circuit_with_memory_optimized_config
Function which calls test_circuit_internal with a memory-optimized default.
test_circuit_with_runtime_optimized_config
Function which calls test_circuit_internal with the appropriate expected prover/verifier config.
verify_circuit_internal ๐Ÿ”’
Takes in a verifier-ready VerifiableCircuit<F>, proof config [ProofConfig] and GKR proof in the form of a [TranscriptReader<F, Tr>], and attempts to verify the proof against the circuit.
verify_circuit_with_proof_config
Wrapper around verify_circuit_internal() which uses a verifier config corresponding to the provided prover config.
write_circuit_description_to_file
Writes the circuit description for the provided GKRCircuitDescription to the circuit_description_path specified, in JSON format.