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// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [Federico], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8
9#include <cstdint>
10
15
16namespace bb::avm2 {
17
19 public:
27
31
32 // Native one is used!
34
36
40
42 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
43
44 // This flavor would not be used with ZK Sumcheck
45 static constexpr bool HasZK = false;
46
47 // To achieve fixed proof size and that the recursive verifier circuit is constant, we are using padding in Sumcheck
48 // and Shplemini
49 static constexpr bool USE_PADDING = true;
50
56 public:
58 using Base::Base;
59 };
60
61 class VerificationKey : public StdlibVerificationKey_<CircuitBuilder,
62 NativeFlavor::PrecomputedEntities<Commitment>,
63 NativeVerificationKey,
64 VKSerializationMode::NO_METADATA> {
65 public:
68 {
69 for (auto [native_comm, comm] : zip_view(native_key->get_all(), this->get_all())) {
70 comm = Commitment::from_witness(builder, native_comm);
71 }
72 }
73
81 {
82 using Codec = stdlib::StdlibCodec<FF>;
83
84 size_t num_frs_read = 0;
85 size_t num_frs_Comm = Codec::template calc_num_fields<Commitment>();
86
87 for (Commitment& comm : this->get_all()) {
88 comm =
89 Codec::template deserialize_from_fields<Commitment>(elements.subspan(num_frs_read, num_frs_Comm));
90 num_frs_read += num_frs_Comm;
91 }
92 }
93
94 FF hash_with_origin_tagging([[maybe_unused]] const OriginTag& tag) const override
95 {
96 throw_or_abort("Not intended to be used because vk is hardcoded in circuit.");
97 }
98
104 {
105 for (Commitment& commitment : this->get_all()) {
106 commitment.fix_witness();
107 }
108 }
109 };
110
113};
114
115} // 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:353
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
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 BATCHED_RELATION_PARTIAL_LENGTH
Definition flavor.hpp:93
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)
FF hash_with_origin_tagging(const OriginTag &tag) const override
Tag VK components and hash.
VerificationKey(std::span< const FF > elements)
Deserialize a verification key from a vector of field elements.
static constexpr size_t NUM_SUBRELATIONS
NativeFlavor::Relations_< FF > Relations
AvmRecursiveFlavorSettings::BF BF
static constexpr size_t NUM_RELATIONS
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
AvmRecursiveFlavorSettings::GroupElement GroupElement
static constexpr size_t NUM_ALL_ENTITIES
static constexpr bool USE_PADDING
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)