Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
sumcheck_test_bench_shared.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
13
14namespace bb {
15
22 size_t num_app_circuits, auto& precomputed_vks, const bool large_first_app = true)
23{
24 PrivateFunctionExecutionMockCircuitProducer circuit_producer(num_app_circuits, large_first_app);
25 const size_t NUM_CIRCUITS = circuit_producer.total_num_circuits;
26 SumcheckClientIVC ivc{ NUM_CIRCUITS };
27
28 BB_ASSERT_EQ(precomputed_vks.size(), NUM_CIRCUITS, "There should be a precomputed VK for each circuit");
29
30 for (size_t circuit_idx = 0; circuit_idx < NUM_CIRCUITS; ++circuit_idx) {
31 MegaCircuitBuilder circuit;
32 {
33 BB_BENCH_NAME("construct_circuits");
34 circuit = circuit_producer.create_next_circuit(ivc);
35 }
36
37 ivc.accumulate(circuit, precomputed_vks[circuit_idx]);
38 }
39 return { ivc.prove(), ivc.get_vk() };
40}
41
43 const size_t num_app_circuits, const bool large_first_app = true)
44{
45 using CircuitProducer = PrivateFunctionExecutionMockCircuitProducer;
46 CircuitProducer circuit_producer(num_app_circuits, large_first_app);
47 const size_t NUM_CIRCUITS = circuit_producer.total_num_circuits;
48 SumcheckClientIVC ivc{ NUM_CIRCUITS };
49
51 for (size_t j = 0; j < NUM_CIRCUITS; ++j) {
52
53 auto circuit = circuit_producer.create_next_circuit(ivc);
54 auto vk = CircuitProducer::get_verification_key(circuit);
55 vkeys.push_back(vk);
56 ivc.accumulate(circuit, vk);
57 }
58
59 return vkeys;
60}
61
62} // namespace bb
#define BB_ASSERT_EQ(actual, expected,...)
Definition assert.hpp:88
#define BB_BENCH_NAME(name)
Definition bb_bench.hpp:218
The IVC scheme used by the aztec client for private function execution.
Entry point for Barretenberg command-line interface.
std::pair< SumcheckClientIVC::Proof, SumcheckClientIVC::VerificationKey > accumulate_and_prove_ivc_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 > > sumcheck_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