Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
constants.hpp
Go to the documentation of this file.
1#pragma once
2#include <cstddef>
3#include <cstdint>
4
5namespace bb {
6
7// Arbitrarily large constant (> size of the BN254 srs) used to ensure that the evaluations on the hypercube of the
8// permutation argument polynomials (sigmas, ids) are unique, e.g. id[i][j] == id[m][n] iff (i == m && j == n)
9constexpr uint32_t PERMUTATION_ARGUMENT_VALUE_SEPARATOR = 1 << 28;
10
11// The fixed size of the Translator trace where each accumulation gate, corresponding to one UltraOp, will occupy two
12// rows.
13static constexpr uint32_t CONST_TRANSLATOR_MINI_CIRCUIT_LOG_SIZE = 14;
14
15// -1 as each op occupies two rows in Translator trace
16static constexpr uint32_t CONST_OP_QUEUE_LOG_SIZE = CONST_TRANSLATOR_MINI_CIRCUIT_LOG_SIZE - 1;
17
18// The log of the max circuit size assumed in order to achieve constant sized Honk proofs
19// TODO(https://github.com/AztecProtocol/barretenberg/issues/1046): Remove the need for const sized proofs
20static constexpr uint32_t CONST_PROOF_SIZE_LOG_N = 28;
21
22// The log of the max circuit size of circuits being folded. This size is assumed by the PG prover and verifier in order
23// to ensure a constant PG proof size and a PG recursive verifier circuit that is independent of the size of the
24// circuits being folded.
25static constexpr uint32_t CONST_PG_LOG_N = 21;
26
27// The size of the AVMRecursiveVerifier circuit arithmetized with Mega.
28static constexpr uint32_t MEGA_AVM_LOG_N = 21;
29
30static constexpr uint32_t CONST_ECCVM_LOG_N = 16;
31
32// TODO(https://github.com/AztecProtocol/barretenberg/issues/1193): potentially reenable for better memory performance
33// static constexpr uint32_t MAX_LOOKUP_TABLES_SIZE = 80000;
34
35static constexpr uint32_t MAX_DATABUS_SIZE = 10000;
36
37// The number of last rows in ProverPolynomials that are randomized to mask
38// 1) witness commitments,
39// 2) multilinear evaluations of witness polynomials in Sumcheck
40// 3*) multilinear evaluations of shifts of witness polynomials in Sumcheck OR univariate evaluations required in ECCVM
41static constexpr uint32_t NUM_MASKED_ROWS = 3;
42
43// To account for the masked entries of witness polynomials in ZK-Sumcheck, we are disabling all relations in the last
44// `NUM_MASKED_ROWS + 1` rows, where `+1` is needed for the shifts. Namely, any relation involving a shift of a masked
45// polynomial w_shift, can't be satisfied on the row `N - (NUM_MASKED_ROWS + 1)`, as `w_shift.at(N - (NUM_MASKED_ROWS +
46// 1))` is equal to the random value `w.at(N - NUM_MASKED_ROWS)`.
47static constexpr uint32_t NUM_DISABLED_ROWS_IN_SUMCHECK = NUM_MASKED_ROWS + 1;
48
49// For ZK Flavors: the number of the commitments required by Libra and SmallSubgroupIPA.
50static constexpr uint32_t NUM_LIBRA_COMMITMENTS = 3;
51
52// The SmallSubgroupIPA is a sub-protocol used in several Flavors, to prove claimed inner product, the Prover sends 4
53// extra evaluations
54static constexpr uint32_t NUM_SMALL_IPA_EVALUATIONS = 4;
55
56static constexpr uint32_t MERGE_PROOF_SIZE = 49; // used to ensure mock proofs are generated correctly
57
58// There are 5 distinguished wires in ECCVM that have to be opened as univariates to establish the connection between
59// ECCVM and Translator
60static constexpr uint32_t NUM_TRANSLATION_EVALUATIONS = 5;
61// The interleaving trick needed for Translator adds 2 extra claims to Gemini fold claims
62// TODO(https://github.com/AztecProtocol/barretenberg/issues/1293): Decouple Gemini from Interleaving
63static constexpr uint32_t NUM_INTERLEAVING_CLAIMS = 2;
64
65// When we branch a transcript, we want to clearly distinguish between what happened before and after the branching. We
66// increase the `round_index` of the original transcript by `BRANCHING_JUMP`, so that there is a gap of `BRANCHING_JUMP`
67// round indices between what happened before and after the branching. This constant is arbitrary.
68static constexpr size_t BRANCHING_JUMP = 5;
69} // namespace bb
Entry point for Barretenberg command-line interface.
constexpr uint32_t PERMUTATION_ARGUMENT_VALUE_SEPARATOR
Definition constants.hpp:9