Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
serialization.cpp File Reference
#include "barretenberg/vm2/simulation/lib/serialization.hpp"
#include <cassert>
#include <cstdint>
#include <iomanip>
#include <span>
#include <sstream>
#include <string>
#include <unordered_map>
#include <variant>
#include <vector>
#include "barretenberg/common/serialize.hpp"
#include "barretenberg/numeric/uint256/uint256.hpp"
#include "barretenberg/vm2/common/addressing.hpp"
#include "barretenberg/vm2/common/instruction_spec.hpp"
#include "barretenberg/vm2/common/opcodes.hpp"
#include "barretenberg/vm2/common/stringify.hpp"

Go to the source code of this file.

Namespaces

namespace  bb
 Entry point for Barretenberg command-line interface.
 
namespace  bb::avm2
 
namespace  bb::avm2::simulation
 
namespace  bb::avm2::simulation::testonly
 

Functions

const std::unordered_map< WireOpCode, std::vector< OperandType > > & bb::avm2::simulation::testonly::get_instruction_wire_formats ()
 
const std::unordered_map< OperandType, uint32_t > & bb::avm2::simulation::testonly::get_operand_type_sizes ()
 
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.
 
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.
 

Variables

const std::unordered_map< OperandType, uint32_t > bb::avm2::simulation::OPERAND_TYPE_SIZE_BYTES
 
const std::vector< OperandTypebb::avm2::simulation::three_operand_format8
 
const std::vector< OperandTypebb::avm2::simulation::three_operand_format16
 
const std::vector< OperandTypebb::avm2::simulation::kernel_input_operand_format = { OperandType::INDIRECT8, OperandType::UINT16 }
 
const std::vector< OperandTypebb::avm2::simulation::external_call_format
 
const std::unordered_map< WireOpCode, std::vector< OperandType > > bb::avm2::simulation::WireOpCode_WIRE_FORMAT