Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
recursive_flavor.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
9
10namespace bb::avm2 {
11
13 public:
21
25
26 // Native one is used!
28
30
31 // indicates when evaluating sumcheck, edges must be extended to be MAX_TOTAL_RELATION_LENGTH
33
34 static constexpr size_t NUM_WIRES = NativeFlavor::NUM_WIRES;
38
41
43 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
44
45 // This flavor would not be used with ZK Sumcheck
46 static constexpr bool HasZK = false;
47
48 // To achieve fixed proof size and that the recursive verifier circuit is constant, we are using padding in Sumcheck
49 // and Shplemini
50 static constexpr bool USE_PADDING = true;
51
57 public:
59 using Base::Base;
60 };
61
63 : public StdlibVerificationKey_<CircuitBuilder, NativeFlavor::PrecomputedEntities<Commitment>> {
64 public:
67 {
68 for (auto [native_comm, comm] : zip_view(native_key->get_all(), this->get_all())) {
69 comm = Commitment::from_witness(builder, native_comm);
70 }
71 }
72
80 {
81 using Codec = stdlib::StdlibCodec<FF>;
82
83 size_t num_frs_read = 0;
84 size_t num_frs_Comm = Codec::template calc_num_fields<Commitment>();
85
86 for (Commitment& comm : this->get_all()) {
87 comm =
88 Codec::template deserialize_from_fields<Commitment>(elements.subspan(num_frs_read, num_frs_Comm));
89 num_frs_read += num_frs_Comm;
90 }
91 }
92
93 std::vector<FF> to_field_elements() const override { throw_or_abort("Not intended to be used."); }
94 FF hash_through_transcript([[maybe_unused]] const std::string& domain_separator,
95 [[maybe_unused]] Transcript& transcript) const override
96 {
97 throw_or_abort("Not intended to be used because vk is hardcoded in circuit.");
98 }
99
105 {
106 for (Commitment& commitment : this->get_all()) {
107 commitment.fix_witness();
108 }
109 }
110 };
111
114};
115
116} // namespace bb::avm2
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
Base Stdlib verification key class.
Definition flavor.hpp:303
tuple_cat_t< MainRelations_< FF_ >, LookupRelations_< FF_ > > Relations_
Definition flavor.hpp:81
static constexpr size_t NUM_SUBRELATIONS
Definition flavor.hpp:84
AvmFlavorSettings::VerifierCommitmentKey VerifierCommitmentKey
Definition flavor.hpp:43
static constexpr size_t NUM_WITNESS_ENTITIES
Definition flavor.hpp:55
static constexpr size_t NUM_WIRES
Definition flavor.hpp:57
static constexpr bool USE_SHORT_MONOMIALS
Definition flavor.hpp:48
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
Definition flavor.hpp:95
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
Definition flavor.hpp:54
static constexpr size_t NUM_ALL_ENTITIES
Definition flavor.hpp:58
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
void fix_witness()
Fixes witnesses of VK to be constants.
VerificationKey(CircuitBuilder *builder, const std::shared_ptr< NativeVerificationKey > &native_key)
VerificationKey(std::span< const FF > elements)
Deserialize a verification key from a vector of field elements.
FF hash_through_transcript(const std::string &domain_separator, Transcript &transcript) const override
Hashes the vk using the transcript's independent buffer and returns the hash.
std::vector< FF > to_field_elements() const override
Serialize verification key to field elements.
static constexpr size_t NUM_SUBRELATIONS
NativeFlavor::Relations_< FF > Relations
AvmRecursiveFlavorSettings::BF BF
static constexpr size_t NUM_WIRES
static constexpr size_t NUM_RELATIONS
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
AvmRecursiveFlavorSettings::GroupElement GroupElement
static constexpr size_t NUM_ALL_ENTITIES
static constexpr bool USE_PADDING
static constexpr size_t NUM_WITNESS_ENTITIES
AvmRecursiveFlavorSettings::FF FF
std::array< FF, NUM_SUBRELATIONS - 1 > SubrelationSeparators
static constexpr bool USE_SHORT_MONOMIALS
AvmRecursiveFlavorSettings::Commitment Commitment
AluTraceBuilder builder
Definition alu.test.cpp:123
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
constexpr std::size_t MAX_AVM_TRACE_LOG_SIZE
Definition constants.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
void throw_or_abort(std::string const &err)