Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
chonk_recursive_verifier.test.cpp
Go to the documentation of this file.
6
8class ChonkRecursionTests : public testing::Test {
9 public:
17 using MockCircuitProducer = PrivateFunctionExecutionMockCircuitProducer;
20
22
27
33 static ChonkProverOutput construct_chonk_prover_output(const size_t num_app_circuits = 1)
34 {
35 // Construct and accumulate a series of mocked private function execution circuits
36 MockCircuitProducer circuit_producer{ num_app_circuits };
37 const size_t NUM_CIRCUITS = circuit_producer.total_num_circuits;
38 Chonk ivc{ NUM_CIRCUITS };
39
40 for (size_t idx = 0; idx < NUM_CIRCUITS; ++idx) {
41 circuit_producer.construct_and_accumulate_next_circuit(ivc);
42 }
43
44 return { ivc.prove(), ivc.get_vk() };
45 }
46};
47
52TEST_F(ChonkRecursionTests, NativeVerification)
53{
54 auto [proof, vk] = construct_chonk_prover_output();
55
56 // Confirm that the IVC proof can be natively verified
57 EXPECT_TRUE(Chonk::verify(proof, vk));
58}
59
65{
66 using ChonkRecVerifierOutput = ChonkRecursiveVerifier::Output;
67
68 // Generate a genuine Chonk prover output
69 auto [proof, vk] = construct_chonk_prover_output();
70
71 // Construct the Chonk recursive verifier
73 ChonkVerifier verifier{ &builder, vk.mega };
74
75 // Generate the recursive verification circuit
76 StdlibProof stdlib_proof(builder, proof);
77 ChonkRecVerifierOutput output = verifier.verify(stdlib_proof);
78
79 EXPECT_EQ(builder.failed(), false) << builder.err();
80
81 EXPECT_TRUE(CircuitChecker::check(builder));
82
83 // Print the number of gates post finalization
84 info("Recursive Verifier: finalized num gates = ", builder.num_gates());
85}
86} // namespace bb::stdlib::recursion::honk
The IVC scheme used by the aztec client for private function execution.
Definition chonk.hpp:38
Proof prove()
Construct a proof for the IVC, which, if verified, fully establishes its correctness.
Definition chonk.cpp:511
static bool verify(const Proof &proof, const VerificationKey &vk)
Definition chonk.cpp:528
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
The recursive counterpart to the "native" UltraRollupFlavor.
PrivateFunctionExecutionMockCircuitProducer MockCircuitProducer
static ChonkProverOutput construct_chonk_prover_output(const size_t num_app_circuits=1)
Construct a genuine Chonk prover output based on accumulation of an arbitrary set of mock circuits.
void info(Args... args)
Definition log.hpp:75
AluTraceBuilder builder
Definition alu.test.cpp:124
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 kernel (whi...
Definition chonk.hpp:91
An object storing two EC points that represent the inputs to a pairing check.