Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
mega_recursive_flavor.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
20
21namespace bb {
22
37template <typename BuilderType> class MegaRecursiveFlavor_ {
38 public:
39 using CircuitBuilder = BuilderType; // Determines arithmetization of circuit instantiated with this flavor
41 using PCS = KZG<Curve>;
42 using GroupElement = typename Curve::Element;
43 using FF = typename Curve::ScalarField;
44 using Commitment = typename Curve::Element;
46
48 static constexpr size_t VIRTUAL_LOG_N = MegaFlavor::VIRTUAL_LOG_N;
49 // indicates when evaluating sumcheck, edges can be left as degree-1 monomials
51 // Note(luke): Eventually this may not be needed at all
53 // Indicates that this flavor runs with non-ZK Sumcheck.
54 static constexpr bool HasZK = false;
55 // To achieve fixed proof size and that the recursive verifier circuit is constant, we are using padding in Sumcheck
56 // and Shplemini
57 static constexpr bool USE_PADDING = MegaFlavor::USE_PADDING;
58 static constexpr size_t NUM_WIRES = MegaFlavor::NUM_WIRES;
59 // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We often
60 // need containers of this size to hold related data, so we choose a name more agnostic than `NUM_POLYNOMIALS`.
61 // Note: this number does not include the individual sorted list polynomials.
63 // The number of polynomials precomputed to describe a circuit and to aid a prover in constructing a satisfying
64 // assignment of witnesses. We again choose a neutral name.
66 // The total number of witness entities not including shifts.
68
69 // define the tuple of Relations that comprise the Sumcheck relation
70 // Reuse the Relations from Mega
72
73 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
74
75 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
76 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
77 // length = 3
79
80 static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n = VIRTUAL_LOG_N)
81 {
83 };
85
87
88 // A challenge whose powers are used to batch subrelation contributions during Sumcheck
91
97 public:
99 using Base::Base;
100 };
101
105
110
112 // Reuse the VerifierCommitments from Mega
114
116};
117
118} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
A container for commitment labels.
A base class labelling precomputed entities and (ordered) subsets of interest.
Container for all witness polynomials used/constructed by the prover.
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
std::tuple< bb::ArithmeticRelation< FF >, bb::UltraPermutationRelation< FF >, bb::LogDerivLookupRelation< FF >, bb::DeltaRangeConstraintRelation< FF >, bb::EllipticRelation< FF >, bb::MemoryRelation< FF >, bb::NonNativeFieldRelation< FF >, bb::EccOpQueueRelation< FF >, bb::DatabusLookupRelation< FF >, bb::Poseidon2ExternalRelation< FF >, bb::Poseidon2InternalRelation< FF > > Relations_
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_WIRES
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t VIRTUAL_LOG_N
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=VIRTUAL_LOG_N)
static constexpr bool USE_SHORT_MONOMIALS
static constexpr bool USE_PADDING
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
The recursive counterpart to the "native" Mega flavor.
typename Curve::Element GroupElement
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=VIRTUAL_LOG_N)
typename Curve::Element Commitment
static constexpr size_t NUM_WIRES
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr bool USE_SHORT_MONOMIALS
static constexpr size_t VIRTUAL_LOG_N
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr bool USE_PADDING
static constexpr size_t NUM_ALL_ENTITIES
MegaFlavor::Relations_< FF > Relations
typename Curve::ScalarField FF
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t NUM_RELATIONS
Base Native verification key class.
Definition flavor.hpp:141
Base Stdlib verification key class.
Definition flavor.hpp:353
Wrapper holding a verification key and its precomputed hash.
Definition flavor.hpp:521
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
field_t< CircuitBuilder > ScalarField
Definition bn254.hpp:33