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