Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
mega_zk_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
8
11
12namespace bb {
13
23 public:
24 // MegaZK is only used in production to prove the Hiding Kernel
25 static constexpr size_t VIRTUAL_LOG_N = HIDING_KERNEL_LOG_N;
26
27 // Indicates that this flavor runs with ZK Sumcheck.
28 static constexpr bool HasZK = true;
29
30 // ZK masking lives at rows [NUM_ZERO_ROWS, TRACE_OFFSET); Sumcheck disables rows [0, TRACE_OFFSET).
31 static constexpr size_t TRACE_OFFSET = NUM_DISABLED_ROWS_IN_SUMCHECK;
32
33 // MegaZK does not include a Gemini masking polynomial in its entities; the translator provides one
34 // at the correct joint circuit size in the batched Chonk flow.
35 static constexpr bool HasGeminiMasking = false;
36
37 // The degree has to be increased because the relation is multiplied by the Row Disabling Polynomial
40 "LIBRA_UNIVARIATES_LENGTH must be equal to MegaZKFlavor::BATCHED_RELATION_PARTIAL_LENGTH");
41
42 // Shplemini's remove_repeated_commitments uses offset = HasZK ? 2 : 1. Since MegaZK has HasZK=true
43 // but no masking poly in its entities, the offset is 1 larger than the actual entity layout.
44 // Compensate by shifting indices by -1 relative to MegaFlavor's REPEATED_COMMITMENTS.
47
48 // Size of the final PCS MSM for ZK = non-ZK size + NUM_LIBRA_COMMITMENTS (3)
49 static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n = VIRTUAL_LOG_N)
50 {
51 return NUM_UNSHIFTED_ENTITIES + log_n + 2 + NUM_LIBRA_COMMITMENTS;
52 }
53
56};
57
58} // 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_PRECOMPUTED_ENTITIES
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
VKAndHash_< FF, VerificationKey > VKAndHash
Child class of MegaFlavor that runs with ZK Sumcheck.
static constexpr size_t TRACE_OFFSET
static constexpr bool HasZK
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=VIRTUAL_LOG_N)
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr bool HasGeminiMasking
static constexpr size_t VIRTUAL_LOG_N
Wrapper holding a verification key and its precomputed hash.
Definition flavor.hpp:541
static constexpr uint32_t LIBRA_UNIVARIATES_LENGTH
Definition bn254.hpp:44
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript