Barretenberg
The ZK-SNARK library at the core of Aztec
|
Namespaces | |
namespace | testonly |
Functions | |
TEST (EmitUnencryptedLogTest, Basic) | |
TEST (EmitUnencryptedLogTest, NegativeTooLarge) | |
TEST (EmitUnencryptedLogTest, NegativeMemoryOutOfBounds) | |
TEST (EmitUnencryptedLogTest, NegativeTooManyLogs) | |
TEST (EmitUnencryptedLogTest, NegativeTagMismatch) | |
TEST (EmitUnencryptedLogTest, NegativeStatic) | |
TEST (EmitUnencryptedLogTest, CheckpointListener) | |
std::string | to_string (AddressingEventError e) |
std::string | to_string (AluError e) |
std::vector< FF > | encode_bytecode (std::span< const uint8_t > bytecode) |
FF | compute_public_bytecode_commitment (std::span< const uint8_t > bytecode) |
FF | compute_contract_class_id (const FF &artifact_hash, const FF &private_fn_root, const FF &public_bytecode_commitment) |
FF | hash_public_keys (const PublicKeys &public_keys) |
FF | compute_contract_address (const ContractInstance &contract_instance) |
FF | unconstrained_root_from_path (const FF &leaf_value, const uint64_t leaf_index, std::span< const FF > path) |
FF | unconstrained_compute_leaf_slot (const AztecAddress &contract_address, const FF &slot) |
FF | unconstrained_silo_nullifier (const AztecAddress &contract_address, const FF &nullifier) |
FF | unconstrained_silo_note_hash (const AztecAddress &contract_address, const FF ¬e_hash) |
FF | unconstrained_make_unique_note_hash (const FF &siloed_note_hash, const FF &first_nullifier, uint64_t note_hash_counter) |
Instruction | deserialize_instruction (std::span< const uint8_t > bytecode, size_t pos) |
Parsing of an instruction in the supplied bytecode at byte position pos. This checks that the WireOpCode value is in the defined range and extracts the operands for each WireOpCode based on the specification from OPCODE_WIRE_FORMAT. | |
bool | check_tag (const Instruction &instruction) |
Check whether the instruction must have a tag operand and whether the operand value is in the value tag range. This is specified by OPCODE_WIRE_FORMAT. If the instruction does not have a valid wire opcode or the relevant tag operand is missing, we return false. However, we do not fully validate the instruction. | |
std::array< uint32_t, 8 > | sha256_block (const std::array< uint32_t, 8 > &h_init, const std::array< uint32_t, 16 > &input) |
constexpr uint32_t | ror (uint32_t val, uint32_t shift) |
U256Decomposition | decompose (const uint256_t &x) |
U128Decomposition | decompose (const uint128_t &x) |
BENCHMARK (BM_WrittenSlotsTreeStack) -> Arg(1000) ->Arg(3000) ->Arg(6000) ->Arg(9000) ->Unit(benchmark::kMicrosecond) | |
std::ostream & | operator<< (std::ostream &os, const WrittenPublicDataSlotLeafValue &v) |
WrittenPublicDataSlotsTree | build_public_data_slots_tree () |
Variables | |
constexpr uint32_t | MAX_MEM_ADDR = AVM_HIGHEST_MEM_ADDRESS |
constexpr std::array< std::array< uint8_t, 5 >, 5 > | keccak_rotation_len |
constexpr std::array< std::array< uint8_t, 5 >, 5 > | keccak_pi_rho_x_coords |
constexpr std::array< uint64_t, 24 > | keccak_round_constants |
const std::unordered_map< OperandType, uint32_t > | OPERAND_TYPE_SIZE_BYTES |
const std::vector< OperandType > | three_operand_format8 |
const std::vector< OperandType > | three_operand_format16 |
const std::vector< OperandType > | kernel_input_operand_format = { OperandType::INDIRECT8, OperandType::UINT16 } |
const std::vector< OperandType > | external_call_format |
const std::unordered_map< WireOpCode, std::vector< OperandType > > | WireOpCode_WIRE_FORMAT |
constexpr uint32_t | round_constants [64] |
const uint256_t | TWO_POW_128 = uint256_t(1) << 128 |
const uint128_t | TWO_POW_64 = static_cast<uint128_t>(1) << 64 |
using bb::avm2::simulation::BytecodeId = typedef FF |
Definition at line 16 of file bytecode_events.hpp.
using bb::avm2::simulation::EmitUnencryptedLogEvent = typedef std::variant<EmitUnencryptedLogWriteEvent, CheckPointEventType> |
Definition at line 40 of file emit_unencrypted_log_event.hpp.
using bb::avm2::simulation::index_t = typedef ::bb::crypto::merkle_tree::index_t |
Definition at line 28 of file db_interfaces.hpp.
using bb::avm2::simulation::IndexedLeaf = typedef ::bb::crypto::merkle_tree::IndexedLeaf<LeafValueType> |
Definition at line 31 of file db_interfaces.hpp.
using bb::avm2::simulation::KeccakF1600State = typedef std::array<std::array<uint64_t, 5>, 5> |
Definition at line 19 of file keccakf1600_event.hpp.
using bb::avm2::simulation::KeccakF1600StateMemValues = typedef std::array<std::array<MemoryValue, 5>, 5> |
Definition at line 20 of file keccakf1600_event.hpp.
using bb::avm2::simulation::MerkleTreeId = typedef ::bb::world_state::MerkleTreeId |
Definition at line 26 of file db_interfaces.hpp.
using bb::avm2::simulation::NoteHashTreeCheckEvent = typedef std::variant<NoteHashTreeReadWriteEvent, CheckPointEventType> |
Definition at line 48 of file note_hash_tree_check_event.hpp.
using bb::avm2::simulation::NullifierLeafValue = typedef ::bb::crypto::merkle_tree::NullifierLeafValue |
Definition at line 30 of file db_interfaces.hpp.
using bb::avm2::simulation::NullifierTreeCheckEvent = typedef std::variant<NullifierTreeReadWriteEvent, CheckPointEventType> |
Definition at line 47 of file nullifier_tree_check_event.hpp.
using bb::avm2::simulation::NullifierTreeLeafPreimage = typedef IndexedLeaf<NullifierLeafValue> |
Definition at line 12 of file nullifier_tree_check_event.hpp.
using bb::avm2::simulation::Operand = typedef TaggedValue |
Definition at line 28 of file serialization.hpp.
using bb::avm2::simulation::poseidon2 = typedef crypto::Poseidon2<crypto::Poseidon2Bn254ScalarFieldParams> |
Definition at line 9 of file contract_crypto.cpp.
typedef crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams > bb::avm2::simulation::Poseidon2 |
Definition at line 10 of file merkle.cpp.
using bb::avm2::simulation::Poseidon2Hash = typedef crypto::Poseidon2<crypto::Poseidon2Bn254ScalarFieldParams> |
Definition at line 7 of file fake_poseidon2.cpp.
using bb::avm2::simulation::Poseidon2Perm = typedef crypto::Poseidon2Permutation<crypto::Poseidon2Bn254ScalarFieldParams> |
Definition at line 8 of file fake_poseidon2.cpp.
using bb::avm2::simulation::PublicDataLeafValue = typedef ::bb::crypto::merkle_tree::PublicDataLeafValue |
Definition at line 29 of file db_interfaces.hpp.
using bb::avm2::simulation::PublicDataTreeCheckEvent = typedef std::variant<PublicDataTreeReadWriteEvent, CheckPointEventType> |
Definition at line 42 of file public_data_tree_check_event.hpp.
Definition at line 12 of file public_data_tree_check_event.hpp.
typedef crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams > bb::avm2::simulation::RawPoseidon2 |
Definition at line 17 of file l1_to_l2_message_tree_check.test.cpp.
using bb::avm2::simulation::SequentialInsertionResult = typedef ::bb::world_state::SequentialInsertionResult<LeafValueType> |
Definition at line 33 of file db_interfaces.hpp.
Definition at line 27 of file db_interfaces.hpp.
using bb::avm2::simulation::TxEvent = typedef std::variant<TxStartupEvent, TxPhaseEvent> |
Definition at line 66 of file tx_events.hpp.
using bb::avm2::simulation::TxPhaseEventType = typedef std::variant<EnqueuedCallEvent, PrivateAppendTreeEvent, PrivateEmitL2L1MessageEvent, CollectGasFeeEvent, PadTreesEvent, CleanupEvent> |
Definition at line 51 of file tx_events.hpp.
using bb::avm2::simulation::WrittenPublicDataSlotsTree = typedef IndexedMemoryTree<WrittenPublicDataSlotLeafValue, Poseidon2HashPolicy> |
Definition at line 38 of file written_slots_tree.hpp.
using bb::avm2::simulation::WrittenPublicDataSlotsTreeLeafPreimage = typedef IndexedLeaf<WrittenPublicDataSlotLeafValue> |
Definition at line 40 of file written_slots_tree.hpp.
|
strong |
Enumerator | |
---|---|
BASE_ADDRESS_INVALID | |
RELATIVE_COMPUTATION_OOB | |
INVALID_ADDRESS_AFTER_INDIRECTION |
Definition at line 14 of file addressing_event.hpp.
|
strong |
Enumerator | |
---|---|
TAG_ERROR | |
DIV_0_ERROR |
Definition at line 27 of file alu_event.hpp.
|
strong |
Enumerator | |
---|---|
ADD | |
SUB | |
MUL | |
DIV | |
FDIV | |
EQ | |
LT | |
LTE | |
NOT | |
SHL | |
SHR | |
TRUNCATE |
Definition at line 12 of file alu_event.hpp.
Enumerator | |
---|---|
CREATE_CHECKPOINT | |
COMMIT_CHECKPOINT | |
REVERT_CHECKPOINT |
Definition at line 7 of file checkpoint_event_type.hpp.
|
strong |
Enumerator | |
---|---|
CD_COPY | |
RD_COPY |
Definition at line 16 of file data_copy_events.hpp.
|
strong |
Enumerator | |
---|---|
NONE | |
BYTECODE_NOT_FOUND | |
INSTRUCTION_FETCHING | |
ADDRESSING | |
REGISTER_READ | |
GAS | |
OPCODE_EXECUTION |
Definition at line 21 of file execution_event.hpp.
|
strong |
Enumerator | |
---|---|
GREATER_THAN | |
CANONICAL_DECOMPOSITION |
Definition at line 9 of file field_gt_event.hpp.
|
strong |
Enumerator | |
---|---|
PC_OUT_OF_RANGE | |
OPCODE_OUT_OF_RANGE | |
INSTRUCTION_OUT_OF_RANGE | |
TAG_OUT_OF_RANGE | |
INVALID_EXECUTION_OPCODE |
Definition at line 50 of file serialization.hpp.
|
strong |
Enumerator | |
---|---|
READ | |
WRITE |
Definition at line 9 of file memory_event.hpp.
|
strong |
Enumerator | |
---|---|
INDIRECT8 | |
INDIRECT16 | |
TAG | |
UINT8 | |
UINT16 | |
UINT32 | |
UINT64 | |
UINT128 | |
FF |
Definition at line 19 of file serialization.hpp.
|
strong |
Enumerator | |
---|---|
NULLIFIER |
Definition at line 7 of file siloing_event.hpp.
bb::avm2::simulation::BENCHMARK | ( | BM_WrittenSlotsTreeStack | ) | -> Arg(1000) ->Arg(3000) ->Arg(6000) ->Arg(9000) ->Unit(benchmark::kMicrosecond) |
WrittenPublicDataSlotsTree bb::avm2::simulation::build_public_data_slots_tree | ( | ) |
Definition at line 58 of file written_slots_tree.cpp.
bool bb::avm2::simulation::check_tag | ( | const Instruction & | instruction | ) |
Check whether the instruction must have a tag operand and whether the operand value is in the value tag range. This is specified by OPCODE_WIRE_FORMAT. If the instruction does not have a valid wire opcode or the relevant tag operand is missing, we return false. However, we do not fully validate the instruction.
instruction | The instruction to be checked upon. |
Definition at line 403 of file serialization.cpp.
FF bb::avm2::simulation::compute_contract_address | ( | const ContractInstance & | contract_instance | ) |
Definition at line 68 of file contract_crypto.cpp.
FF bb::avm2::simulation::compute_contract_class_id | ( | const FF & | artifact_hash, |
const FF & | private_fn_root, | ||
const FF & | public_bytecode_commitment | ||
) |
Definition at line 48 of file contract_crypto.cpp.
FF bb::avm2::simulation::compute_public_bytecode_commitment | ( | std::span< const uint8_t > | bytecode | ) |
Definition at line 40 of file contract_crypto.cpp.
U128Decomposition bb::avm2::simulation::decompose | ( | const uint128_t & | x | ) |
Definition at line 16 of file uint_decomposition.cpp.
U256Decomposition bb::avm2::simulation::decompose | ( | const uint256_t & | x | ) |
Definition at line 9 of file uint_decomposition.cpp.
Instruction bb::avm2::simulation::deserialize_instruction | ( | std::span< const uint8_t > | bytecode, |
size_t | pos | ||
) |
Parsing of an instruction in the supplied bytecode at byte position pos. This checks that the WireOpCode value is in the defined range and extracts the operands for each WireOpCode based on the specification from OPCODE_WIRE_FORMAT.
bytecode | The bytecode to be parsed as a vector of bytes/uint8_t |
pos | Bytecode position |
runtime_error | exception when the bytecode is invalid or pos is out-of-range |
Definition at line 213 of file serialization.cpp.
std::vector< FF > bb::avm2::simulation::encode_bytecode | ( | std::span< const uint8_t > | bytecode | ) |
Definition at line 11 of file contract_crypto.cpp.
FF bb::avm2::simulation::hash_public_keys | ( | const PublicKeys & | public_keys | ) |
Definition at line 54 of file contract_crypto.cpp.
std::ostream & bb::avm2::simulation::operator<< | ( | std::ostream & | os, |
const WrittenPublicDataSlotLeafValue & | v | ||
) |
Definition at line 17 of file written_slots_tree.cpp.
|
constexpr |
Definition at line 11 of file sha256_compression.hpp.
std::array< uint32_t, 8 > bb::avm2::simulation::sha256_block | ( | const std::array< uint32_t, 8 > & | h_init, |
const std::array< uint32_t, 16 > & | input | ||
) |
Fill first 16 words with the message schedule
Extend the input data into the remaining 48 words
Initialize round variables with previous block output
Apply SHA-256 compression function to the message schedule
Add into previous block output and return
Definition at line 23 of file sha256_compression.cpp.
bb::avm2::simulation::TEST | ( | EmitUnencryptedLogTest | , |
Basic | |||
) |
Definition at line 20 of file emit_unencrypted_log.test.cpp.
bb::avm2::simulation::TEST | ( | EmitUnencryptedLogTest | , |
CheckpointListener | |||
) |
Definition at line 349 of file emit_unencrypted_log.test.cpp.
bb::avm2::simulation::TEST | ( | EmitUnencryptedLogTest | , |
NegativeMemoryOutOfBounds | |||
) |
Definition at line 135 of file emit_unencrypted_log.test.cpp.
bb::avm2::simulation::TEST | ( | EmitUnencryptedLogTest | , |
NegativeStatic | |||
) |
Definition at line 294 of file emit_unencrypted_log.test.cpp.
bb::avm2::simulation::TEST | ( | EmitUnencryptedLogTest | , |
NegativeTagMismatch | |||
) |
Definition at line 239 of file emit_unencrypted_log.test.cpp.
bb::avm2::simulation::TEST | ( | EmitUnencryptedLogTest | , |
NegativeTooLarge | |||
) |
Definition at line 74 of file emit_unencrypted_log.test.cpp.
bb::avm2::simulation::TEST | ( | EmitUnencryptedLogTest | , |
NegativeTooManyLogs | |||
) |
Definition at line 184 of file emit_unencrypted_log.test.cpp.
|
inline |
Definition at line 23 of file addressing_event.hpp.
|
inline |
Definition at line 32 of file alu_event.hpp.
FF bb::avm2::simulation::unconstrained_compute_leaf_slot | ( | const AztecAddress & | contract_address, |
const FF & | slot | ||
) |
Definition at line 26 of file merkle.cpp.
FF bb::avm2::simulation::unconstrained_make_unique_note_hash | ( | const FF & | siloed_note_hash, |
const FF & | first_nullifier, | ||
uint64_t | note_hash_counter | ||
) |
Definition at line 41 of file merkle.cpp.
FF bb::avm2::simulation::unconstrained_root_from_path | ( | const FF & | leaf_value, |
const uint64_t | leaf_index, | ||
std::span< const FF > | path | ||
) |
Definition at line 12 of file merkle.cpp.
FF bb::avm2::simulation::unconstrained_silo_note_hash | ( | const AztecAddress & | contract_address, |
const FF & | note_hash | ||
) |
Definition at line 36 of file merkle.cpp.
FF bb::avm2::simulation::unconstrained_silo_nullifier | ( | const AztecAddress & | contract_address, |
const FF & | nullifier | ||
) |
Definition at line 31 of file merkle.cpp.
const std::vector<OperandType> bb::avm2::simulation::external_call_format |
Definition at line 43 of file serialization.cpp.
|
constexpr |
Definition at line 29 of file keccakf1600.hpp.
|
constexpr |
Definition at line 18 of file keccakf1600.hpp.
|
constexpr |
Definition at line 39 of file keccakf1600.hpp.
const std::vector<OperandType> bb::avm2::simulation::kernel_input_operand_format = { OperandType::INDIRECT8, OperandType::UINT16 } |
Definition at line 41 of file serialization.cpp.
|
constexpr |
Definition at line 12 of file data_copy.cpp.
const std::unordered_map<OperandType, uint32_t> bb::avm2::simulation::OPERAND_TYPE_SIZE_BYTES |
Definition at line 22 of file serialization.cpp.
|
constexpr |
Definition at line 11 of file sha256_compression.cpp.
const std::vector<OperandType> bb::avm2::simulation::three_operand_format16 |
Definition at line 35 of file serialization.cpp.
const std::vector<OperandType> bb::avm2::simulation::three_operand_format8 |
Definition at line 29 of file serialization.cpp.
Definition at line 6 of file uint_decomposition.cpp.
Definition at line 7 of file uint_decomposition.cpp.
const std::unordered_map<WireOpCode, std::vector<OperandType> > bb::avm2::simulation::WireOpCode_WIRE_FORMAT |
Definition at line 52 of file serialization.cpp.