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
3
#include <array>
4
#include <cstddef>
5
#include <cstdint>
6
7
#include "barretenberg/aztec/aztec_constants.hpp"
8
#include "
barretenberg/numeric/uint128/uint128.hpp
"
9
#include "
barretenberg/numeric/uint256/uint256.hpp
"
10
11
namespace
bb::avm2
{
12
13
constexpr
std::size_t
MAX_AVM_TRACE_LOG_SIZE
= 21;
14
constexpr
std::size_t
MAX_AVM_TRACE_SIZE
= 1 <<
MAX_AVM_TRACE_LOG_SIZE
;
15
16
// Exact number of rows used by each AVM public input column. Column 0 spans the full table;
17
// columns 1-3 are shorter, so the recursive verifier avoids hashing / MLE-evaluating their
18
// trailing zeros. Sourced from the generated per-column constants (see constants.nr).
19
constexpr
std::array<std::size_t, AVM_NUM_PUBLIC_INPUT_COLUMNS>
AVM_PUBLIC_INPUTS_COLUMN_LENGTHS
= {
20
AVM_PUBLIC_INPUTS_COLUMN_0_LENGTH,
21
AVM_PUBLIC_INPUTS_COLUMN_1_LENGTH,
22
AVM_PUBLIC_INPUTS_COLUMN_2_LENGTH,
23
AVM_PUBLIC_INPUTS_COLUMN_3_LENGTH,
24
};
25
26
// The AND/OR/XOR values double as op_id in the circuit trace. A keccak SIMD-64 operation (which
27
// packs two independent U64 lanes into one U128 bitwise row) reuses the same op_id and is flagged
28
// separately via BitwiseEvent::simd_64.
29
enum class
BitwiseOperation
: uint8_t {
30
AND
= AVM_BITWISE_AND_OP_ID,
31
OR
= AVM_BITWISE_OR_OP_ID,
32
XOR
= AVM_BITWISE_XOR_OP_ID,
33
};
34
35
constexpr
uint256_t
MASK_128
= (
static_cast<
uint256_t
>
(1) << 128) - 1;
36
constexpr
uint128_t
MASK_64
= (
static_cast<
uint128_t
>
(1) << 64) - 1;
37
38
}
// namespace bb::avm2
bb::numeric::uint256_t
Definition
uint256.hpp:32
bb::avm2
Definition
dbs.cpp:19
bb::avm2::MAX_AVM_TRACE_SIZE
constexpr std::size_t MAX_AVM_TRACE_SIZE
Definition
constants.hpp:14
bb::avm2::MASK_64
constexpr uint128_t MASK_64
Definition
constants.hpp:36
bb::avm2::MASK_128
constexpr uint256_t MASK_128
Definition
constants.hpp:35
bb::avm2::MAX_AVM_TRACE_LOG_SIZE
constexpr std::size_t MAX_AVM_TRACE_LOG_SIZE
Definition
constants.hpp:13
bb::avm2::BitwiseOperation
BitwiseOperation
Definition
constants.hpp:29
bb::avm2::BitwiseOperation::OR
@ OR
bb::avm2::BitwiseOperation::AND
@ AND
bb::avm2::BitwiseOperation::XOR
@ XOR
bb::avm2::AVM_PUBLIC_INPUTS_COLUMN_LENGTHS
constexpr std::array< std::size_t, AVM_NUM_PUBLIC_INPUT_COLUMNS > AVM_PUBLIC_INPUTS_COLUMN_LENGTHS
Definition
constants.hpp:19
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
uint128_t
unsigned __int128 uint128_t
Definition
serialize.hpp:45
uint128.hpp
uint256.hpp
src
barretenberg
vm2
common
constants.hpp
Generated by
1.9.8