Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
serialization.hpp File Reference
#include "barretenberg/numeric/uint128/uint128.hpp"
#include "barretenberg/vm2/common/field.hpp"
#include "barretenberg/vm2/common/memory_types.hpp"
#include "barretenberg/vm2/common/opcodes.hpp"
#include "barretenberg/vm2/common/tagged_value.hpp"
#include <cstdint>
#include <memory>
#include <variant>
#include <vector>

Go to the source code of this file.

Classes

struct  bb::avm2::simulation::Instruction
 

Namespaces

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

Typedefs

using bb::avm2::simulation::Operand = TaggedValue
 

Enumerations

enum class  bb::avm2::simulation::OperandType : uint8_t {
  bb::avm2::simulation::INDIRECT8 , bb::avm2::simulation::INDIRECT16 , bb::avm2::simulation::TAG , bb::avm2::simulation::UINT8 ,
  bb::avm2::simulation::UINT16 , bb::avm2::simulation::UINT32 , bb::avm2::simulation::UINT64 , bb::avm2::simulation::UINT128 ,
  bb::avm2::simulation::FF
}
 
enum class  bb::avm2::simulation::InstrDeserializationError : uint8_t {
  bb::avm2::simulation::PC_OUT_OF_RANGE , bb::avm2::simulation::OPCODE_OUT_OF_RANGE , bb::avm2::simulation::INSTRUCTION_OUT_OF_RANGE , bb::avm2::simulation::TAG_OUT_OF_RANGE ,
  bb::avm2::simulation::INVALID_EXECUTION_OPCODE
}
 

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.