Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
test_bench_shared.hpp
Go to the documentation of this file.
7
8namespace bb {
9
16 size_t num_app_circuits, auto& precomputed_vks, const bool large_first_app = true)
17{
18 PrivateFunctionExecutionMockCircuitProducer circuit_producer(num_app_circuits, large_first_app);
19 const size_t NUM_CIRCUITS = circuit_producer.total_num_circuits;
20 Chonk ivc{ NUM_CIRCUITS };
21
22 BB_ASSERT_EQ(precomputed_vks.size(), NUM_CIRCUITS, "There should be a precomputed VK for each circuit");
23
24 for (size_t circuit_idx = 0; circuit_idx < NUM_CIRCUITS; ++circuit_idx) {
25 MegaCircuitBuilder circuit;
26 {
27 BB_BENCH_NAME("construct_circuits");
28 circuit = circuit_producer.create_next_circuit(ivc);
29 }
30
31 ivc.accumulate(circuit, precomputed_vks[circuit_idx]);
32 }
33 return { ivc.prove(), ivc.get_hiding_kernel_vk_and_hash() };
34}
35
37 const bool large_first_app = true)
38{
39 using CircuitProducer = PrivateFunctionExecutionMockCircuitProducer;
40 CircuitProducer circuit_producer(num_app_circuits, large_first_app);
41 const size_t NUM_CIRCUITS = circuit_producer.total_num_circuits;
42 Chonk ivc{ NUM_CIRCUITS };
43
45 for (size_t j = 0; j < NUM_CIRCUITS; ++j) {
46
47 auto circuit = circuit_producer.create_next_circuit(ivc);
48 auto vk = CircuitProducer::get_verification_key(circuit);
49 vkeys.push_back(vk);
50 ivc.accumulate(circuit, vk);
51 }
52
53 return vkeys;
54}
55
56} // namespace bb
#define BB_ASSERT_EQ(actual, expected,...)
Definition assert.hpp:93
#define BB_BENCH_NAME(name)
Definition bb_bench.hpp:219
The IVC scheme used by the aztec client for private function execution.
Definition chonk.hpp:38
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::pair< ChonkProof, std::shared_ptr< MegaZKFlavor::VKAndHash > > accumulate_and_prove_with_precomputed_vks(size_t num_app_circuits, auto &precomputed_vks, const bool large_first_app=true)
Perform a specified number of circuit accumulation rounds.
std::vector< std::shared_ptr< typename MegaFlavor::VerificationKey > > precompute_vks(const size_t num_app_circuits, const bool large_first_app=true)
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13