Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
client_ivc_recursive_verifier.test.cpp
Go to the documentation of this file.
7
9class ClientIVCRecursionTests : public testing::Test {
10 public:
18 using MockCircuitProducer = PrivateFunctionExecutionMockCircuitProducer;
21
22 static constexpr TraceSettings trace_settings{ AZTEC_TRACE_STRUCTURE };
23
25
30
35 static ClientIVCProverOutput construct_client_ivc_prover_output(const size_t num_app_circuits = 1)
36 {
37 // Construct and accumulate a series of mocked private function execution circuits
38 MockCircuitProducer circuit_producer{ num_app_circuits };
39 const size_t NUM_CIRCUITS = circuit_producer.total_num_circuits;
40 ClientIVC ivc{ NUM_CIRCUITS, trace_settings };
41
42 for (size_t idx = 0; idx < NUM_CIRCUITS; ++idx) {
43 circuit_producer.construct_and_accumulate_next_circuit(ivc);
44 }
45
46 return { ivc.prove(), ivc.get_vk() };
47 }
48};
49
54TEST_F(ClientIVCRecursionTests, NativeVerification)
55{
56 auto [proof, vk] = construct_client_ivc_prover_output();
57
58 // Confirm that the IVC proof can be natively verified
59 EXPECT_TRUE(ClientIVC::verify(proof, vk));
60}
61
67{
68 using CIVCRecVerifierOutput = ClientIVCRecursiveVerifier::Output;
69
70 // Generate a genuine ClientIVC prover output
71 auto [proof, vk] = construct_client_ivc_prover_output();
72
73 // Construct the ClientIVC recursive verifier
75 ClientIVCVerifier verifier{ &builder, vk.mega };
76
77 // Generate the recursive verification circuit
78 StdlibProof stdlib_proof(builder, proof);
79 CIVCRecVerifierOutput output = verifier.verify(stdlib_proof);
80
81 EXPECT_EQ(builder.failed(), false) << builder.err();
82
83 EXPECT_TRUE(CircuitChecker::check(builder));
84
85 // Print the number of gates post finalization
86 info("Recursive Verifier: finalized num gates = ", builder.num_gates);
87}
88} // namespace bb::stdlib::recursion::honk
The IVC scheme used by the aztec client for private function execution.
static bool verify(const Proof &proof, const VerificationKey &vk)
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
The recursive counterpart to the "native" UltraRollupFlavor.
A simple wrapper around a vector of stdlib field elements representing a proof.
Definition proof.hpp:19
static ClientIVCProverOutput construct_client_ivc_prover_output(const size_t num_app_circuits=1)
Construct a genuine ClientIVC prover output based on accumulation of an arbitrary set of mock circuit...
void info(Args... args)
Definition log.hpp:74
AluTraceBuilder builder
Definition alu.test.cpp:123
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
TEST_F(BoomerangGoblinRecursiveVerifierTests, graph_description_basic)
Construct and check a goblin recursive verification circuit.
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
VerifierCommitmentKey< Curve > vk
A full proof for the IVC scheme containing a Mega proof showing correctness of the hiding circuit (wh...