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: Completed, auditors: [Sergei], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
12
13namespace bb {
14
29template <typename BuilderType> class MegaRecursiveFlavor_ {
30 public:
31 using CircuitBuilder = BuilderType; // Determines arithmetization of circuit instantiated with this flavor
33 using PCS = KZG<Curve>;
34 using GroupElement = typename Curve::Element;
35 using FF = typename Curve::ScalarField;
36 using Commitment = typename Curve::Element;
40
41 static constexpr size_t VIRTUAL_LOG_N = MegaFlavor::VIRTUAL_LOG_N;
42 // indicates when evaluating sumcheck, edges can be left as degree-1 monomials
44 // Indicates that this flavor runs with non-ZK Sumcheck.
45 static constexpr bool HasZK = false;
46 // To achieve fixed proof size and that the recursive verifier circuit is constant, we are using padding in Sumcheck
47 // and Shplemini
48 static constexpr bool USE_PADDING = MegaFlavor::USE_PADDING;
49 static constexpr size_t NUM_WIRES = MegaFlavor::NUM_WIRES;
55 static constexpr bool HasDataBus = MegaFlavor::HasDataBus;
57 // Per-relation capability bools — see flavor-codegen `RELATION_CAPABILITY_BOOLS`.
59 static constexpr bool HasElliptic = MegaFlavor::HasElliptic;
60 static constexpr bool HasMemory = MegaFlavor::HasMemory;
63
64 // define the tuple of Relations that comprise the Sumcheck relation
65 // Reuse the Relations from Mega
67
68 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
69
71
72 static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n = VIRTUAL_LOG_N)
73 {
75 };
77
79
80 // A challenge whose powers are used to batch subrelation contributions during Sumcheck
83
89 public:
91 using Base::Base;
92 };
93
97
102
105
107};
108
109} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
static constexpr size_t NUM_BUS_COLUMNS
static constexpr size_t NUM_ALL_ENTITIES
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
std::tuple< bb::UltraPermutationRelation< FF >, bb::LogDerivLookupRelation< FF >, bb::ArithmeticRelation< FF >, bb::BilinearOrBatchedEqCheckRelation< FF >, bb::DeltaRangeConstraintRelation< FF >, bb::EllipticRelation< FF >, bb::MemoryRelation< FF >, bb::NonNativeFieldRelation< FF >, bb::EccOpQueueRelation< FF >, bb::SingleBusLookupRelation< FF, EntityId::kernel_calldata, EntityId::kernel_calldata_read_counts, EntityId::kernel_calldata_inverses, EntityId::kernel_calldata_indicator, EntityId::q_l >, bb::SingleBusLookupRelation< FF, EntityId::first_app_calldata, EntityId::first_app_calldata_read_counts, EntityId::first_app_calldata_inverses, EntityId::first_app_calldata_indicator, EntityId::q_r >, bb::SingleBusLookupRelation< FF, EntityId::second_app_calldata, EntityId::second_app_calldata_read_counts, EntityId::second_app_calldata_inverses, EntityId::second_app_calldata_indicator, EntityId::q_o >, bb::SingleBusLookupRelation< FF, EntityId::third_app_calldata, EntityId::third_app_calldata_read_counts, EntityId::third_app_calldata_inverses, EntityId::third_app_calldata_indicator, EntityId::q_4 >, bb::SingleBusLookupRelation< FF, EntityId::fourth_app_calldata, EntityId::fourth_app_calldata_read_counts, EntityId::fourth_app_calldata_inverses, EntityId::fourth_app_calldata_indicator, EntityId::q_5 >, bb::SingleBusLookupRelation< FF, EntityId::fifth_app_calldata, EntityId::fifth_app_calldata_read_counts, EntityId::fifth_app_calldata_inverses, EntityId::fifth_app_calldata_indicator, EntityId::q_c >, bb::SingleBusLookupRelation< FF, EntityId::return_data, EntityId::return_data_read_counts, EntityId::return_data_inverses, EntityId::return_data_indicator, EntityId::q_m >, bb::Poseidon2ExternalRelation< FF >, bb::Poseidon2InitialExternalRelation< FF >, bb::Poseidon2QuadInternalRelation< FF >, bb::Poseidon2QuadInternalTerminalRelation< FF >, bb::Poseidon2TransitionEntryRelation< FF > > Relations_
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr bool HasElliptic
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static constexpr bool HasLogDerivLookup
static constexpr bool HasNonNativeField
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr bool HasEccOpQueue
static constexpr size_t NUM_WIRES
static const CommitmentLabels & commitment_labels()
static constexpr size_t NUM_SUBRELATIONS
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
AllEntities< std::string > CommitmentLabels
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 bool HasLogDerivLookup
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_UNSHIFTED_ENTITIES
static constexpr size_t NUM_WIRES
static constexpr bool HasDataBus
static constexpr bool HasMemory
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr bool USE_SHORT_MONOMIALS
static constexpr size_t VIRTUAL_LOG_N
static constexpr bool HasNonNativeField
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
static const CommitmentLabels & commitment_labels()
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr bool USE_PADDING
static constexpr bool HasElliptic
static constexpr size_t NUM_ALL_ENTITIES
MegaFlavor::Relations_< FF > Relations
typename Curve::ScalarField FF
MegaFlavor::CommitmentLabels CommitmentLabels
static constexpr bool HasEccOpQueue
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t NUM_RELATIONS
static constexpr size_t NUM_BUS_COLUMNS
Base Native verification key class.
Definition flavor.hpp:138
Base Stdlib verification key class.
Definition flavor.hpp:378
Wrapper holding a verification key and its precomputed hash.
Definition flavor.hpp:551
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:30