Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ultra_keccak_flavor.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7// TODO: the only change should be making honk generic over the transcript
8#pragma once
30
31namespace bb {
32
34 public:
36
37 static constexpr bool USE_PADDING = false;
38
39 // Override as proof length is different
40 static constexpr size_t num_elements_comm = bb::field_conversion::calc_num_uint256_ts<Commitment>();
41 static constexpr size_t num_elements_fr = bb::field_conversion::calc_num_uint256_ts<FF>();
42
43 // Proof length formula methods
44 static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS =
45 /* 1. NUM_WITNESS_ENTITIES commitments */ (NUM_WITNESS_ENTITIES * num_elements_comm);
46
47 static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n = VIRTUAL_LOG_N)
48 {
49 return /* 2. virtual_log_n sumcheck univariates */
51 /* 3. NUM_ALL_ENTITIES sumcheck evaluations */ (NUM_ALL_ENTITIES * num_elements_fr) +
52 /* 4. virtual_log_n - 1 Gemini Fold commitments */ ((virtual_log_n - 1) * num_elements_comm) +
53 /* 5. virtual_log_n Gemini a evaluations */ (virtual_log_n * num_elements_fr) +
54 /* 6. Shplonk Q commitment */ (num_elements_comm) +
55 /* 7. KZG W commitment */ (num_elements_comm);
56 }
57
58 static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n = VIRTUAL_LOG_N)
59 {
61 }
62
71 // TODO(https://github.com/AztecProtocol/barretenberg/issues/1094): Add aggregation to the verifier contract so the
72 // VerificationKey from UltraFlavor can be used
73 class VerificationKey : public NativeVerificationKey_<PrecomputedEntities<Commitment>, Transcript> {
74 public:
75 static constexpr size_t VERIFICATION_KEY_LENGTH =
76 /* 1. Metadata (log_circuit_size, num_public_inputs, pub_inputs_offset) */ (3 * num_elements_fr) +
77 /* 2. NUM_PRECOMPUTED_ENTITIES commitments */ (NUM_PRECOMPUTED_ENTITIES * num_elements_comm);
78
79 VerificationKey() = default;
80 VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
82 {}
83
84 VerificationKey(const PrecomputedData& precomputed)
85 {
89
90 CommitmentKey commitment_key{ precomputed.metadata.dyadic_size };
91 for (auto [polynomial, commitment] : zip_view(precomputed.polynomials, this->get_all())) {
92 commitment = commitment_key.commit(polynomial);
93 }
94 }
95
96 // Don't statically check for object completeness.
97 using MSGPACK_NO_STATIC_CHECK = std::true_type;
98
99 // For serialising and deserializing data
103 q_m,
104 q_c,
105 q_l,
106 q_r,
107 q_o,
108 q_4,
109 q_lookup,
110 q_arith,
111 q_delta_range,
112 q_elliptic,
113 q_memory,
114 q_nnf,
115 q_poseidon2_external,
116 q_poseidon2_internal,
117 sigma_1,
118 sigma_2,
119 sigma_3,
120 sigma_4,
121 id_1,
122 id_2,
123 id_3,
124 id_4,
125 table_1,
126 table_2,
127 table_3,
128 table_4,
129 lagrange_first,
130 lagrange_last);
131 };
132
133 // Specialize for Ultra (general case used in UltraRecursive).
135};
136
137} // namespace bb
CommitmentKey object over a pairing group 𝔾₁.
Base Native verification key class.
Definition flavor.hpp:152
Derived class that defines proof structure for Ultra proofs, as well as supporting functions.
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_PRECOMPUTED_ENTITIES
static constexpr size_t VIRTUAL_LOG_N
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t NUM_WITNESS_ENTITIES
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
VerificationKey(const PrecomputedData &precomputed)
MSGPACK_FIELDS(log_circuit_size, num_public_inputs, pub_inputs_offset, q_m, q_c, q_l, q_r, q_o, q_4, q_lookup, q_arith, q_delta_range, q_elliptic, q_memory, q_nnf, q_poseidon2_external, q_poseidon2_internal, sigma_1, sigma_2, sigma_3, sigma_4, id_1, id_2, id_3, id_4, table_1, table_2, table_3, table_4, lagrange_first, lagrange_last)
VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
static constexpr bool USE_PADDING
static constexpr size_t num_elements_comm
static constexpr size_t num_elements_fr
static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
constexpr T get_msb(const T in)
Definition get_msb.hpp:47
Entry point for Barretenberg command-line interface.
size_t pub_inputs_offset
Definition flavor.hpp:132
size_t num_public_inputs
Definition flavor.hpp:131
size_t dyadic_size
Definition flavor.hpp:130
The precomputed data needed to compute a Honk VK.
Definition flavor.hpp:138
RefArray< Polynomial, NUM_PRECOMPUTED_ENTITIES > polynomials
Definition flavor.hpp:139