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
10
11namespace bb {
12
14 public:
16
17 static constexpr bool USE_PADDING = false;
18
19 // Override as proof length is different
20 static constexpr size_t num_elements_comm = U256Codec::calc_num_fields<Commitment>();
21 static constexpr size_t num_elements_fr = U256Codec::calc_num_fields<FF>();
22
23 // Proof length formula methods
24 static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS =
25 /* 1. NUM_WITNESS_ENTITIES commitments */ (NUM_WITNESS_ENTITIES * num_elements_comm);
26
27 static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n = VIRTUAL_LOG_N)
28 {
29 return /* 2. virtual_log_n sumcheck univariates */
31 /* 3. NUM_ALL_ENTITIES sumcheck evaluations */ (NUM_ALL_ENTITIES * num_elements_fr) +
32 /* 4. virtual_log_n - 1 Gemini Fold commitments */ ((virtual_log_n - 1) * num_elements_comm) +
33 /* 5. virtual_log_n Gemini a evaluations */ (virtual_log_n * num_elements_fr) +
34 /* 6. Shplonk Q commitment */ (num_elements_comm) +
35 /* 7. KZG W commitment */ (num_elements_comm);
36 }
37
38 static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n = VIRTUAL_LOG_N)
39 {
41 }
42
51 // TODO(https://github.com/AztecProtocol/barretenberg/issues/1094): Add aggregation to the verifier contract so the
52 // VerificationKey from UltraFlavor can be used
53 class VerificationKey : public NativeVerificationKey_<PrecomputedEntities<Commitment>, Transcript> {
54 public:
55 static constexpr size_t VERIFICATION_KEY_LENGTH =
56 /* 1. Metadata (log_circuit_size, num_public_inputs, pub_inputs_offset) */ (3 * num_elements_fr) +
57 /* 2. NUM_PRECOMPUTED_ENTITIES commitments */ (NUM_PRECOMPUTED_ENTITIES * num_elements_comm);
58 VerificationKey() = default;
59 VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
61 {}
62
63 VerificationKey(const PrecomputedData& precomputed)
64 {
68
69 CommitmentKey commitment_key{ precomputed.metadata.dyadic_size };
70 for (auto [polynomial, commitment] : zip_view(precomputed.polynomials, this->get_all())) {
71 commitment = commitment_key.commit(polynomial);
72 }
73 }
74 };
75
76 // Specialize for Ultra (general case used in UltraRecursive).
78};
79
80} // namespace bb
CommitmentKey object over a pairing group 𝔾₁.
Base Native verification key class.
Definition flavor.hpp:161
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)
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
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:139
size_t num_public_inputs
Definition flavor.hpp:138
size_t dyadic_size
Definition flavor.hpp:137
The precomputed data needed to compute a Honk VK.
Definition flavor.hpp:145
RefArray< Polynomial, NUM_PRECOMPUTED_ENTITIES > polynomials
Definition flavor.hpp:146