Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
SafeUintFuzzBase< Builder >::ExecutionHandler Class Reference

This class implements the execution of safeuint with an oracle to detect discrepancies. More...

#include <safe_uint.fuzzer.hpp>

Public Member Functions

 ExecutionHandler ()=default
 
 ExecutionHandler (uint512_t &r, suint_t &s)
 
 ExecutionHandler (uint512_t r, suint_t s)
 
 ExecutionHandler (suint_t s)
 
ExecutionHandler operator+ (const ExecutionHandler &other)
 
ExecutionHandler subtract (const ExecutionHandler &other, size_t difference_bit_size)
 
ExecutionHandler operator- (const ExecutionHandler &other)
 
ExecutionHandler operator* (const ExecutionHandler &other)
 
ExecutionHandler divide (const ExecutionHandler &other, size_t quotient_bit_size, size_t remainder_bit_size)
 
ExecutionHandler operator/ (const ExecutionHandler &other)
 
ExecutionHandler add_two (const ExecutionHandler &other1, const ExecutionHandler &other2)
 
ExecutionHandler madd (const ExecutionHandler &other1, const ExecutionHandler &other2)
 
std::array< ExecutionHandler, 3 > slice (uint8_t lsb, uint8_t msb)
 

Static Public Member Functions

static size_t execute_CONSTANT (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the constant instruction (push constant safeuint to the stack)
 
static size_t execute_WITNESS (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the witness instruction (push witness safeuit to the stack)
 
static size_t execute_CONSTANT_WITNESS (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the constant_witness instruction (push a safeuint witness equal to the constant to the stack)
 
static size_t execute_MULTIPLY (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the multiply instruction.
 
static size_t execute_ADD (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the addition operator instruction.
 
static size_t execute_SUBTRACT (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the subtraction operator instruction.
 
static size_t execute_DIVIDE (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the division operator instruction.
 
static size_t execute_ADD_TWO (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the ADD_TWO instruction.
 
static size_t execute_MADD (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the MADD instruction.
 
static size_t execute_SUBTRACT_WITH_CONSTRAINT (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the SUBTRACT_WITH_CONSTRAINT instruction.
 
static size_t execute_DIVIDE_WITH_CONSTRAINTS (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 
static size_t execute_SLICE (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the slice instruction.
 
static size_t execute_RANDOMSEED (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the RANDOMSEED instruction.
 

Public Attributes

uint512_t reference_value
 
suint_t suint
 

Private Member Functions

suint_t s () const
 

Detailed Description

template<typename Builder>
class SafeUintFuzzBase< Builder >::ExecutionHandler

This class implements the execution of safeuint with an oracle to detect discrepancies.

Definition at line 594 of file safe_uint.fuzzer.hpp.

Constructor & Destructor Documentation

◆ ExecutionHandler() [1/4]

template<typename Builder >
SafeUintFuzzBase< Builder >::ExecutionHandler::ExecutionHandler ( )
default

◆ ExecutionHandler() [2/4]

template<typename Builder >
SafeUintFuzzBase< Builder >::ExecutionHandler::ExecutionHandler ( uint512_t &  r,
suint_t s 
)
inline

Definition at line 613 of file safe_uint.fuzzer.hpp.

◆ ExecutionHandler() [3/4]

template<typename Builder >
SafeUintFuzzBase< Builder >::ExecutionHandler::ExecutionHandler ( uint512_t  r,
suint_t  s 
)
inline

Definition at line 622 of file safe_uint.fuzzer.hpp.

◆ ExecutionHandler() [4/4]

template<typename Builder >
SafeUintFuzzBase< Builder >::ExecutionHandler::ExecutionHandler ( suint_t  s)
inline

Definition at line 633 of file safe_uint.fuzzer.hpp.

Member Function Documentation

◆ add_two()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::add_two ( const ExecutionHandler other1,
const ExecutionHandler other2 
)
inline

Definition at line 679 of file safe_uint.fuzzer.hpp.

◆ divide()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::divide ( const ExecutionHandler other,
size_t  quotient_bit_size,
size_t  remainder_bit_size 
)
inline

Definition at line 657 of file safe_uint.fuzzer.hpp.

◆ execute_ADD()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_ADD ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the addition operator instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 843 of file safe_uint.fuzzer.hpp.

◆ execute_ADD_TWO()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_ADD_TWO ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the ADD_TWO instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered size_t

Definition at line 1018 of file safe_uint.fuzzer.hpp.

◆ execute_CONSTANT()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_CONSTANT ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the constant instruction (push constant safeuint to the stack)

Parameters
builder
stack
instruction
Returns
0 if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 719 of file safe_uint.fuzzer.hpp.

◆ execute_CONSTANT_WITNESS()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_CONSTANT_WITNESS ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the constant_witness instruction (push a safeuint witness equal to the constant to the stack)

Parameters
builder
stack
instruction
Returns
0 if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 772 of file safe_uint.fuzzer.hpp.

◆ execute_DIVIDE()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_DIVIDE ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the division operator instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 954 of file safe_uint.fuzzer.hpp.

◆ execute_DIVIDE_WITH_CONSTRAINTS()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_DIVIDE_WITH_CONSTRAINTS ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic
      @brief Execute the DIVIDE_WITH_CONSTRAINTS instruction

      @param builder
      @param stack
      @param instruction
      @return if everything is ok, 1 if we should stop execution, since an expected error was

encountered

Definition at line 1177 of file safe_uint.fuzzer.hpp.

◆ execute_MADD()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_MADD ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the MADD instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered size_t

Definition at line 1069 of file safe_uint.fuzzer.hpp.

◆ execute_MULTIPLY()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_MULTIPLY ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the multiply instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 791 of file safe_uint.fuzzer.hpp.

◆ execute_RANDOMSEED()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_RANDOMSEED ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the RANDOMSEED instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 1299 of file safe_uint.fuzzer.hpp.

◆ execute_SLICE()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_SLICE ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the slice instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered size_t

Definition at line 1250 of file safe_uint.fuzzer.hpp.

◆ execute_SUBTRACT()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_SUBTRACT ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the subtraction operator instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 887 of file safe_uint.fuzzer.hpp.

◆ execute_SUBTRACT_WITH_CONSTRAINT()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_SUBTRACT_WITH_CONSTRAINT ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the SUBTRACT_WITH_CONSTRAINT instruction.

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered size_t

Definition at line 1122 of file safe_uint.fuzzer.hpp.

◆ execute_WITNESS()

template<typename Builder >
static size_t SafeUintFuzzBase< Builder >::ExecutionHandler::execute_WITNESS ( Builder builder,
std::vector< ExecutionHandler > &  stack,
Instruction instruction 
)
inlinestatic

Execute the witness instruction (push witness safeuit to the stack)

Parameters
builder
stack
instruction
Returns
if everything is ok, 1 if we should stop execution, since an expected error was encountered

Definition at line 740 of file safe_uint.fuzzer.hpp.

◆ madd()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::madd ( const ExecutionHandler other1,
const ExecutionHandler other2 
)
inline

Definition at line 686 of file safe_uint.fuzzer.hpp.

◆ operator*()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::operator* ( const ExecutionHandler other)
inline

Definition at line 653 of file safe_uint.fuzzer.hpp.

◆ operator+()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::operator+ ( const ExecutionHandler other)
inline

Definition at line 637 of file safe_uint.fuzzer.hpp.

◆ operator-()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::operator- ( const ExecutionHandler other)
inline

Definition at line 649 of file safe_uint.fuzzer.hpp.

◆ operator/()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::operator/ ( const ExecutionHandler other)
inline

Definition at line 670 of file safe_uint.fuzzer.hpp.

◆ s()

template<typename Builder >
suint_t SafeUintFuzzBase< Builder >::ExecutionHandler::s ( ) const
inlineprivate

Definition at line 595 of file safe_uint.fuzzer.hpp.

◆ slice()

template<typename Builder >
std::array< ExecutionHandler, 3 > SafeUintFuzzBase< Builder >::ExecutionHandler::slice ( uint8_t  lsb,
uint8_t  msb 
)
inline

Definition at line 693 of file safe_uint.fuzzer.hpp.

◆ subtract()

template<typename Builder >
ExecutionHandler SafeUintFuzzBase< Builder >::ExecutionHandler::subtract ( const ExecutionHandler other,
size_t  difference_bit_size 
)
inline

Definition at line 641 of file safe_uint.fuzzer.hpp.

Member Data Documentation

◆ reference_value

template<typename Builder >
uint512_t SafeUintFuzzBase< Builder >::ExecutionHandler::reference_value

Definition at line 609 of file safe_uint.fuzzer.hpp.

◆ suint

template<typename Builder >
suint_t SafeUintFuzzBase< Builder >::ExecutionHandler::suint

Definition at line 611 of file safe_uint.fuzzer.hpp.


The documentation for this class was generated from the following file: