Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
mega_zk_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
13
14namespace bb {
15
25template <typename BuilderType> class MegaZKRecursiveFlavor_ {
26 public:
27 using CircuitBuilder = BuilderType;
29 using PCS = KZG<Curve>;
30 using GroupElement = typename Curve::Element;
31 using FF = typename Curve::ScalarField;
32 using Commitment = typename Curve::Element;
36
37 static constexpr size_t VIRTUAL_LOG_N = MegaZKFlavor::VIRTUAL_LOG_N;
39 // Recursive verifier for MegaZK runs ZK Sumcheck.
40 static constexpr bool HasZK = true;
41 static constexpr bool HasGeminiMasking = false;
42 static constexpr bool USE_PADDING = MegaZKFlavor::USE_PADDING;
43 static constexpr size_t NUM_WIRES = MegaZKFlavor::NUM_WIRES;
49 static constexpr bool HasDataBus = MegaZKFlavor::HasDataBus;
51 // Per-relation capability bools — must match MegaZKFlavor (reduced relation set).
53 static constexpr bool HasElliptic = MegaZKFlavor::HasElliptic;
54 static constexpr bool HasMemory = MegaZKFlavor::HasMemory;
57
58 // Reuse MegaZK's relation tuple (instantiated over the stdlib FF).
60
61 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
62
63 // Match the native flavor's batched length so prover/verifier univariates agree.
65
66 static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n = VIRTUAL_LOG_N)
67 {
69 };
71
75
77 public:
79 using Base::Base;
80 };
81
82 static_assert(gemini_masking_layout_consistent<MegaZKRecursiveFlavor_>(),
83 "MegaZKRecursiveFlavor gemini masking flag must match its entity layout");
84
88
90
93
95};
96
97} // 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
std::tuple< bb::ArithmeticRelation< FF >, bb::BilinearOrBatchedEqCheckRelation< FF >, bb::UltraPermutationRelation< FF >, bb::DeltaRangeConstraintRelation< FF >, bb::EccOpQueueRelation< FF >, bb::MegaEccOpBoundaryRelation< FF >, bb::SingleBusLookupRelation< FF, EntityId::kernel_calldata, EntityId::kernel_calldata_read_counts, EntityId::kernel_calldata_inverses, EntityId::kernel_calldata_indicator, EntityId::q_l >, bb::Poseidon2ExternalRelation< FF >, bb::Poseidon2InitialExternalRelation< FF >, bb::Poseidon2QuadInternalRelation< FF >, bb::Poseidon2QuadInternalTerminalRelation< FF >, bb::Poseidon2TransitionEntryRelation< FF > > Relations_
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr size_t NUM_UNSHIFTED_ENTITIES
Hiding-kernel-only Mega variant: runs with ZK Sumcheck and a reduced relation set.
static constexpr size_t NUM_SUBRELATIONS
static constexpr bool USE_PADDING
static constexpr size_t NUM_WIRES
static constexpr bool USE_SHORT_MONOMIALS
AllEntities< std::string > CommitmentLabels
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static const CommitmentLabels & commitment_labels()
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=VIRTUAL_LOG_N)
static constexpr size_t VIRTUAL_LOG_N
The recursive counterpart to MegaZKFlavor.
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static const CommitmentLabels & commitment_labels()
MegaZKFlavor::CommitmentLabels CommitmentLabels
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
MegaZKFlavor::Relations_< FF > Relations
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_ALL_ENTITIES
static constexpr bool USE_SHORT_MONOMIALS
static constexpr size_t NUM_BUS_COLUMNS
static constexpr size_t VIRTUAL_LOG_N
static constexpr size_t NUM_WITNESS_ENTITIES
typename Curve::ScalarField FF
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=VIRTUAL_LOG_N)
static constexpr size_t NUM_RELATIONS
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