barretenberg
Loading...
Searching...
No Matches
AvmMini_composer.hpp
1
2
3#pragma once
4
5#include "barretenberg/proof_system/circuit_builder/generated/AvmMini_circuit_builder.hpp"
6#include "barretenberg/proof_system/composer/composer_lib.hpp"
7#include "barretenberg/srs/global_crs.hpp"
8#include "barretenberg/vm/generated/AvmMini_prover.hpp"
9#include "barretenberg/vm/generated/AvmMini_verifier.hpp"
10
11namespace proof_system::honk {
13 public:
18 using PCS = Flavor::PCS;
21
22 // TODO: which of these will we really need
23 static constexpr std::string_view NAME_STRING = "AvmMini";
24 static constexpr size_t NUM_RESERVED_GATES = 0;
25 static constexpr size_t NUM_WIRES = Flavor::NUM_WIRES;
26
27 std::shared_ptr<ProvingKey> proving_key;
28 std::shared_ptr<VerificationKey> verification_key;
29
30 // The crs_factory holds the path to the srs and exposes methods to extract the srs elements
31 std::shared_ptr<barretenberg::srs::factories::CrsFactory<Flavor::Curve>> crs_factory_;
32
33 // The commitment key is passed to the prover but also used herein to compute the verfication key commitments
34 std::shared_ptr<CommitmentKey> commitment_key;
35
36 std::vector<uint32_t> recursive_proof_public_input_indices;
37 bool contains_recursive_proof = false;
38 bool computed_witness = false;
39
40 AvmMiniComposer() { crs_factory_ = barretenberg::srs::get_crs_factory(); }
41
42 AvmMiniComposer(std::shared_ptr<ProvingKey> p_key, std::shared_ptr<VerificationKey> v_key)
43 : proving_key(std::move(p_key))
44 , verification_key(std::move(v_key))
45 {}
46
47 AvmMiniComposer(AvmMiniComposer&& other) noexcept = default;
48 AvmMiniComposer(AvmMiniComposer const& other) noexcept = default;
49 AvmMiniComposer& operator=(AvmMiniComposer&& other) noexcept = default;
50 AvmMiniComposer& operator=(AvmMiniComposer const& other) noexcept = default;
51 ~AvmMiniComposer() = default;
52
53 std::shared_ptr<ProvingKey> compute_proving_key(CircuitConstructor& circuit_constructor);
54 std::shared_ptr<VerificationKey> compute_verification_key(CircuitConstructor& circuit_constructor);
55
56 void compute_witness(CircuitConstructor& circuit_constructor);
57
58 AvmMiniProver create_prover(CircuitConstructor& circuit_constructor);
59 AvmMiniVerifier create_verifier(CircuitConstructor& circuit_constructor);
60
61 void add_table_column_selector_poly_to_proving_key(barretenberg::polynomial& small, const std::string& tag);
62
63 void compute_commitment_key(size_t circuit_size)
64 {
65 commitment_key = std::make_shared<CommitmentKey>(circuit_size, crs_factory_);
66 };
67};
68
69} // namespace proof_system::honk
Definition: AvmMini_circuit_builder.hpp:46
Definition: AvmMini_composer.hpp:12
Definition: AvmMini_prover.hpp:13
Definition: AvmMini_verifier.hpp:9
Definition: AvmMini_flavor.hpp:21
CommitmentKey object over a pairing group 𝔾₁.
Definition: commitment_key.hpp:35
Definition: verification_key.hpp:25
Definition: kzg.hpp:14
Defines particular circuit builder types expected to be used for circuit construction in stdlib and c...
Definition: claim.hpp:6