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 static constexpr size_t NUM_WIRES = NativeFlavor::NUM_WIRES;
35
38
40 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
41
42 // This flavor would not be used with ZK Sumcheck
43 static constexpr bool HasZK = false;
44
45 // To achieve fixed proof size and that the recursive verifier circuit is constant, we are using padding in Sumcheck
46 // and Shplemini
47 static constexpr bool USE_PADDING = true;
48
54 public:
56 using Base::Base;
57 };
58
60 : public StdlibVerificationKey_<CircuitBuilder, NativeFlavor::PrecomputedEntities<Commitment>> {
61 public:
64 {
65 for (auto [native_comm, comm] : zip_view(native_key->get_all(), this->get_all())) {
66 comm = Commitment::from_witness(builder, native_comm);
67 }
68 }
69
77 {
78 using Codec = stdlib::StdlibCodec<FF>;
79
80 size_t num_frs_read = 0;
81 size_t num_frs_Comm = Codec::template calc_num_fields<Commitment>();
82
83 for (Commitment& comm : this->get_all()) {
84 comm =
85 Codec::template deserialize_from_fields<Commitment>(elements.subspan(num_frs_read, num_frs_Comm));
86 num_frs_read += num_frs_Comm;
87 }
88 }
89
90 std::vector<FF> to_field_elements() const override { throw_or_abort("Not intended to be used."); }
91 FF hash_with_origin_tagging([[maybe_unused]] const std::string& domain_separator,
92 [[maybe_unused]] Transcript& transcript) const override
93 {
94 throw_or_abort("Not intended to be used because vk is hardcoded in circuit.");
95 }
96
102 {
103 for (Commitment& commitment : this->get_all()) {
104 commitment.fix_witness();
105 }
106 }
107 };
108
111};
112
113} // 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:325
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 size_t BATCHED_RELATION_PARTIAL_LENGTH
Definition flavor.hpp:93
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.
std::vector< FF > to_field_elements() const override
Serialize verification key to field elements.
FF hash_with_origin_tagging(const std::string &domain_separator, Transcript &transcript) const override
Tag VK components and hash.
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
AvmRecursiveFlavorSettings::Commitment Commitment
AluTraceBuilder builder
Definition alu.test.cpp:124
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:12
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
void throw_or_abort(std::string const &err)