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

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

#include <field.fuzzer.hpp>

Public Member Functions

 ExecutionHandler ()=default
 
 ExecutionHandler (bb::fr a, field_t b)
 
 ExecutionHandler (bb::fr a, field_t &b)
 
 ExecutionHandler (bb::fr &a, field_t &b)
 
ExecutionHandler operator+ (const ExecutionHandler &other)
 
ExecutionHandler operator- (const ExecutionHandler &other)
 
ExecutionHandler operator* (const ExecutionHandler &other)
 
ExecutionHandler sqr ()
 
ExecutionHandler operator/ (const ExecutionHandler &other)
 
ExecutionHandler add_two (const ExecutionHandler &other1, const ExecutionHandler &other2)
 
ExecutionHandler madd (const ExecutionHandler &other1, const ExecutionHandler &other2)
 
void assert_equal (ExecutionHandler &other)
 
void assert_not_equal (ExecutionHandler &other)
 
void assert_zero ()
 
void assert_not_zero ()
 
ExecutionHandler conditional_negate (Builder *builder, const bool predicate)
 
ExecutionHandler conditional_select (Builder *builder, ExecutionHandler &other, const bool predicate)
 
ExecutionHandler select_if_zero (Builder *builder, ExecutionHandler &other1, ExecutionHandler &other2)
 
ExecutionHandler select_if_eq (Builder *builder, ExecutionHandler &other1, ExecutionHandler &other2)
 
ExecutionHandler set (Builder *builder)
 
ExecutionHandler invert (void) const
 

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_SQR (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the SQR instruction.
 
static size_t execute_ASSERT_EQUAL (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the ASSERT_EQUAL instruction.
 
static size_t execute_ASSERT_NOT_EQUAL (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the ASSERT_NOT_EQUAL instruction.
 
static size_t execute_ASSERT_ZERO (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the ASSERT_ZERO instruction.
 
static size_t execute_ASSERT_NOT_ZERO (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the ASSERT_NOT_ZERO 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_RANDOMSEED (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the RANDOMSEED instruction.
 
static size_t execute_COND_NEGATE (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the COND_NEGATE instruction.
 
static size_t execute_COND_SELECT (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the COND_SELECT instruction.
 
static size_t execute_SELECT_IF_ZERO (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the SELECT_IF_ZERO instruction.
 
static size_t execute_SELECT_IF_EQ (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the SELECT_IF_EQ instruction.
 
static size_t execute_SET (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the SET instruction.
 
static size_t execute_INVERT (Builder *builder, std::vector< ExecutionHandler > &stack, Instruction &instruction)
 Execute the INVERT instruction.
 

Public Attributes

bb::fr base
 
field_t field
 

Private Member Functions

template<class T >
ExecutionHandler construct_via_cast (const std::optional< uint256_t > max=std::nullopt, const std::optional< T > value=std::nullopt) const
 
field_t f () const
 
void assert_equal (field_t f) const
 

Static Private Member Functions

static bool_t construct_predicate (Builder *builder, const bool predicate)
 

Detailed Description

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

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

Definition at line 664 of file field.fuzzer.hpp.

Constructor & Destructor Documentation

◆ ExecutionHandler() [1/4]

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

◆ ExecutionHandler() [2/4]

template<typename Builder >
FieldBase< Builder >::ExecutionHandler::ExecutionHandler ( bb::fr  a,
field_t  b 
)
inline

Definition at line 727 of file field.fuzzer.hpp.

◆ ExecutionHandler() [3/4]

template<typename Builder >
FieldBase< Builder >::ExecutionHandler::ExecutionHandler ( bb::fr  a,
field_t b 
)
inline

Definition at line 731 of file field.fuzzer.hpp.

◆ ExecutionHandler() [4/4]

template<typename Builder >
FieldBase< Builder >::ExecutionHandler::ExecutionHandler ( bb::fr a,
field_t b 
)
inline

Definition at line 735 of file field.fuzzer.hpp.

Member Function Documentation

◆ add_two()

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

Definition at line 823 of file field.fuzzer.hpp.

◆ assert_equal() [1/2]

template<typename Builder >
void FieldBase< Builder >::ExecutionHandler::assert_equal ( ExecutionHandler other)
inline

Definition at line 842 of file field.fuzzer.hpp.

◆ assert_equal() [2/2]

template<typename Builder >
void FieldBase< Builder >::ExecutionHandler::assert_equal ( field_t  f) const
inlineprivate

Definition at line 709 of file field.fuzzer.hpp.

◆ assert_not_equal()

template<typename Builder >
void FieldBase< Builder >::ExecutionHandler::assert_not_equal ( ExecutionHandler other)
inline

Definition at line 865 of file field.fuzzer.hpp.

◆ assert_not_zero()

template<typename Builder >
void FieldBase< Builder >::ExecutionHandler::assert_not_zero ( )
inline

Definition at line 881 of file field.fuzzer.hpp.

◆ assert_zero()

template<typename Builder >
void FieldBase< Builder >::ExecutionHandler::assert_zero ( )
inline

Definition at line 874 of file field.fuzzer.hpp.

◆ conditional_negate()

template<typename Builder >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::conditional_negate ( Builder builder,
const bool  predicate 
)
inline

Definition at line 889 of file field.fuzzer.hpp.

◆ conditional_select()

template<typename Builder >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::conditional_select ( Builder builder,
ExecutionHandler other,
const bool  predicate 
)
inline

Definition at line 895 of file field.fuzzer.hpp.

◆ construct_predicate()

template<typename Builder >
static bool_t FieldBase< Builder >::ExecutionHandler::construct_predicate ( Builder builder,
const bool  predicate 
)
inlinestaticprivate

Definition at line 689 of file field.fuzzer.hpp.

◆ construct_via_cast()

template<typename Builder >
template<class T >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::construct_via_cast ( const std::optional< uint256_t max = std::nullopt,
const std::optional< T >  value = std::nullopt 
) const
inlineprivate

Definition at line 667 of file field.fuzzer.hpp.

◆ execute_ADD()

template<typename Builder >
static size_t FieldBase< 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 1111 of file field.fuzzer.hpp.

◆ execute_ADD_TWO()

template<typename Builder >
static size_t FieldBase< 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 1377 of file field.fuzzer.hpp.

◆ execute_ASSERT_EQUAL()

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

Execute the ASSERT_EQUAL 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 1182 of file field.fuzzer.hpp.

◆ execute_ASSERT_NOT_EQUAL()

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

Execute the ASSERT_NOT_EQUAL 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 1210 of file field.fuzzer.hpp.

◆ execute_ASSERT_NOT_ZERO()

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

Execute the ASSERT_NOT_ZERO 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 1269 of file field.fuzzer.hpp.

◆ execute_ASSERT_ZERO()

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

Execute the ASSERT_ZERO 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 1238 of file field.fuzzer.hpp.

◆ execute_COND_NEGATE()

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

Execute the COND_NEGATE 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 1467 of file field.fuzzer.hpp.

◆ execute_COND_SELECT()

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

Execute the COND_SELECT 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 1501 of file field.fuzzer.hpp.

◆ execute_CONSTANT()

template<typename Builder >
static size_t FieldBase< 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 1006 of file field.fuzzer.hpp.

◆ execute_CONSTANT_WITNESS()

template<typename Builder >
static size_t FieldBase< 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 1053 of file field.fuzzer.hpp.

◆ execute_DIVIDE()

template<typename Builder >
static size_t FieldBase< 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 1334 of file field.fuzzer.hpp.

◆ execute_INVERT()

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

Execute the INVERT 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 1636 of file field.fuzzer.hpp.

◆ execute_MADD()

template<typename Builder >
static size_t FieldBase< 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 1413 of file field.fuzzer.hpp.

◆ execute_MULTIPLY()

template<typename Builder >
static size_t FieldBase< 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 1075 of file field.fuzzer.hpp.

◆ execute_RANDOMSEED()

template<typename Builder >
static size_t FieldBase< 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 1449 of file field.fuzzer.hpp.

◆ execute_SELECT_IF_EQ()

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

Execute the SELECT_IF_EQ 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 1569 of file field.fuzzer.hpp.

◆ execute_SELECT_IF_ZERO()

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

Execute the SELECT_IF_ZERO 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 1535 of file field.fuzzer.hpp.

◆ execute_SET()

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

Execute the SET 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 1603 of file field.fuzzer.hpp.

◆ execute_SQR()

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

Execute the SQR 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 1147 of file field.fuzzer.hpp.

◆ execute_SUBTRACT()

template<typename Builder >
static size_t FieldBase< 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 1299 of file field.fuzzer.hpp.

◆ execute_WITNESS()

template<typename Builder >
static size_t FieldBase< 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 1028 of file field.fuzzer.hpp.

◆ f()

template<typename Builder >
field_t FieldBase< Builder >::ExecutionHandler::f ( ) const
inlineprivate

Definition at line 699 of file field.fuzzer.hpp.

◆ invert()

template<typename Builder >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::invert ( void  ) const
inline

Definition at line 989 of file field.fuzzer.hpp.

◆ madd()

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

Definition at line 837 of file field.fuzzer.hpp.

◆ operator*()

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

Definition at line 780 of file field.fuzzer.hpp.

◆ operator+()

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

Definition at line 739 of file field.fuzzer.hpp.

◆ operator-()

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

Definition at line 761 of file field.fuzzer.hpp.

◆ operator/()

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

Definition at line 800 of file field.fuzzer.hpp.

◆ select_if_eq()

template<typename Builder >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::select_if_eq ( Builder builder,
ExecutionHandler other1,
ExecutionHandler other2 
)
inline

Definition at line 908 of file field.fuzzer.hpp.

◆ select_if_zero()

template<typename Builder >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::select_if_zero ( Builder builder,
ExecutionHandler other1,
ExecutionHandler other2 
)
inline

Definition at line 902 of file field.fuzzer.hpp.

◆ set()

template<typename Builder >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::set ( Builder builder)
inline

Definition at line 915 of file field.fuzzer.hpp.

◆ sqr()

template<typename Builder >
ExecutionHandler FieldBase< Builder >::ExecutionHandler::sqr ( )
inline

Definition at line 799 of file field.fuzzer.hpp.

Member Data Documentation

◆ base

template<typename Builder >
bb::fr FieldBase< Builder >::ExecutionHandler::base

Definition at line 724 of file field.fuzzer.hpp.

◆ field

template<typename Builder >
field_t FieldBase< Builder >::ExecutionHandler::field

Definition at line 725 of file field.fuzzer.hpp.


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