Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ultra_zk_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
8
12
13namespace bb {
14
24class UltraZKFlavor : public UltraFlavor {
25 public:
26 // This flavor runs with ZK Sumcheck
27 static constexpr bool HasZK = true;
28
29 // The number of entities added for ZK (gemini_masking_poly)
30 static constexpr size_t NUM_MASKING_POLYNOMIALS = 1;
31
32 // Determine the number of evaluations of Prover and Libra Polynomials that the Prover sends to the Verifier in
33 // the rounds of ZK Sumcheck.
36 "LIBRA_UNIVARIATES_LENGTH must be equal to UltraZKFlavor::BATCHED_RELATION_PARTIAL_LENGTH");
37
38 // Override AllEntities to use ZK version (includes gemini_masking_poly via MaskingEntities)
39 template <typename DataType> using AllEntities = UltraFlavor::AllEntities_<DataType, HasZK>;
40
41 // NUM_WITNESS_ENTITIES includes gemini_masking_poly
43 // NUM_ALL_ENTITIES includes gemini_masking_poly
45 // NUM_UNSHIFTED_ENTITIES includes gemini_masking_poly
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 = CONST_PROOF_SIZE_LOG_N)
50 {
51 return NUM_UNSHIFTED_ENTITIES + log_n + 2 + NUM_LIBRA_COMMITMENTS;
52 }
53
54 // Override OINK_PROOF_LENGTH to include gemini_masking_poly commitment (sent via commit_to_masking_poly)
55 static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS =
56 /* 1. NUM_WITNESS_ENTITIES commitments (includes gemini_masking_poly) */ (NUM_WITNESS_ENTITIES * num_frs_comm);
57
62
63 // Override ProverUnivariates and ExtendedEdges to include gemini_masking_poly
66
67 // Proof length formula method
68 static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n = CONST_PROOF_SIZE_LOG_N)
69 {
70 return /* 1. NUM_WITNESS_ENTITIES commitments */ (NUM_WITNESS_ENTITIES * num_frs_comm) +
71 /* 2. Libra concatenation commitment*/ (num_frs_comm) +
72 /* 3. Libra sum */ (num_frs_fr) +
73 /* 4. virtual_log_n sumcheck univariates */
75 /* 5. NUM_ALL_ENTITIES sumcheck evaluations*/ (NUM_ALL_ENTITIES * num_frs_fr) +
76 /* 6. Libra claimed evaluation */ (num_frs_fr) +
77 /* 7. Libra grand sum commitment */ (num_frs_comm) +
78 /* 8. Libra quotient commitment */ (num_frs_comm) +
79 /* 9. virtual_log_n - 1 Gemini Fold commitments */
80 ((virtual_log_n - 1) * num_frs_comm) +
81 /* 10. virtual_log_n Gemini a evaluations */
82 (virtual_log_n * num_frs_fr) +
83 /* 11. NUM_SMALL_IPA_EVALUATIONS libra evals */ (NUM_SMALL_IPA_EVALUATIONS * num_frs_fr) +
84 /* 12. Shplonk Q commitment */ (num_frs_comm) +
85 /* 13. KZG W commitment */ (num_frs_comm);
86 }
87};
88} // namespace bb
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
A container for storing the partially evaluated multivariates produced by sumcheck.
A container for polynomials handles.
A container encapsulating all the commitments that the verifier receives (to precomputed polynomials ...
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t num_frs_comm
static constexpr size_t num_frs_fr
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static constexpr size_t NUM_WITNESS_ENTITIES
Child class of UltraFlavor that runs with ZK Sumcheck.
static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS
static constexpr bool HasZK
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=CONST_PROOF_SIZE_LOG_N)
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=CONST_PROOF_SIZE_LOG_N)
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t NUM_MASKING_POLYNOMIALS
static constexpr uint32_t LIBRA_UNIVARIATES_LENGTH
Definition bn254.hpp:46
Entry point for Barretenberg command-line interface.
Definition api.hpp:5