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 log of the max circuit size assumed in order to achieve constant sized Honk proofs
12// TODO(https://github.com/AztecProtocol/barretenberg/issues/1046): Remove the need for const sized proofs
13static constexpr uint32_t CONST_PROOF_SIZE_LOG_N = 28;
14
15// The log of the max circuit size of circuits being folded. This size is assumed by the PG prover and verifier in order
16// to ensure a constant PG proof size and a PG recursive verifier circuit that is independent of the size of the
17// circuits being folded.
18static constexpr uint32_t CONST_PG_LOG_N = 21;
19
20// The size of the AVMRecursiveVerifier circuit arithmetized with Mega.
21static constexpr uint32_t MEGA_AVM_LOG_N = 21;
22
23static constexpr uint32_t CONST_ECCVM_LOG_N = 16;
24
25// TODO(https://github.com/AztecProtocol/barretenberg/issues/1193): potentially reenable for better memory performance
26// static constexpr uint32_t MAX_LOOKUP_TABLES_SIZE = 80000;
27
28static constexpr uint32_t MAX_DATABUS_SIZE = 10000;
29
30// The number of last rows in ProverPolynomials that are randomized to mask
31// 1) witness commitments,
32// 2) multilinear evaluations of witness polynomials in Sumcheck
33// 3*) multilinear evaluations of shifts of witness polynomials in Sumcheck OR univariate evaluations required in ECCVM
34static constexpr uint32_t NUM_MASKED_ROWS = 3;
35
36// To account for the masked entries of witness polynomials in ZK-Sumcheck, we are disabling all relations in the last
37// `NUM_MASKED_ROWS + 1` rows, where `+1` is needed for the shifts. Namely, any relation involving a shift of a masked
38// polynomial w_shift, can't be satisfied on the row `N - (NUM_MASKED_ROWS + 1)`, as `w_shift.at(N - (NUM_MASKED_ROWS +
39// 1))` is equal to the random value `w.at(N - NUM_MASKED_ROWS)`.
40static constexpr uint32_t NUM_DISABLED_ROWS_IN_SUMCHECK = NUM_MASKED_ROWS + 1;
41
42// For ZK Flavors: the number of the commitments required by Libra and SmallSubgroupIPA.
43static constexpr uint32_t NUM_LIBRA_COMMITMENTS = 3;
44
45// The SmallSubgroupIPA is a sub-protocol used in several Flavors, to prove claimed inner product, the Prover sends 4
46// extra evaluations
47static constexpr uint32_t NUM_SMALL_IPA_EVALUATIONS = 4;
48
49static constexpr uint32_t MERGE_PROOF_SIZE = 49; // used to ensure mock proofs are generated correctly
50
51// There are 5 distinguished wires in ECCVM that have to be opened as univariates to establish the connection between
52// ECCVM and Translator
53static constexpr uint32_t NUM_TRANSLATION_EVALUATIONS = 5;
54// The interleaving trick needed for Translator adds 2 extra claims to Gemini fold claims
55// TODO(https://github.com/AztecProtocol/barretenberg/issues/1293): Decouple Gemini from Interleaving
56static constexpr uint32_t NUM_INTERLEAVING_CLAIMS = 2;
57
58// When we branch a transcript, we want to clearly distinguish between what happened before and after the branching. We
59// increase the `round_index` of the original transcript by `BRANCHING_JUMP`, so that there is a gap of `BRANCHING_JUMP`
60// round indices between what happened before and after the branching. This constant is arbitrary.
61static constexpr size_t BRANCHING_JUMP = 5;
62} // namespace bb
Entry point for Barretenberg command-line interface.
constexpr uint32_t PERMUTATION_ARGUMENT_VALUE_SEPARATOR
Definition constants.hpp:9