Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
safe_uint.fuzzer.hpp File Reference

Go to the source code of this file.

Classes

class  SafeUintFuzzBase< Builder >
 The class parametrizing SafeUint fuzzing instructions, execution, etc. More...
 
class  SafeUintFuzzBase< Builder >::Instruction
 A class representing a single fuzzing instruction. More...
 
struct  SafeUintFuzzBase< Builder >::Instruction::Element
 
struct  SafeUintFuzzBase< Builder >::Instruction::ThreeArgs
 
struct  SafeUintFuzzBase< Builder >::Instruction::FourArgs
 
struct  SafeUintFuzzBase< Builder >::Instruction::FiveArgs
 
struct  SafeUintFuzzBase< Builder >::Instruction::SliceArgs
 
union  SafeUintFuzzBase< Builder >::Instruction::ArgumentContents
 
class  SafeUintFuzzBase< Builder >::ArgSizes
 
class  SafeUintFuzzBase< Builder >::Parser
 Parser class handles the parsing and writing the instructions back to data buffer. More...
 
class  SafeUintFuzzBase< Builder >::ExecutionHandler
 This class implements the execution of safeuint with an oracle to detect discrepancies. More...
 

Macros

#define HAVOC_TESTING
 
#define PRINT_TWO_ARG_INSTRUCTION(first_index, second_index, vector, operation_name, preposition)
 
#define PRINT_TWO_ARG_ONE_VALUE_INSTRUCTION( first_index, second_index, third_index, vector, operation_name, preposition1, preposition2)
 
#define PRINT_TWO_ARG_TWO_VALUES_INSTRUCTION( first_index, second_index, value1, value2, vector, operation_name, preposition1, preposition2, preposition3)
 
#define PRINT_THREE_ARG_INSTRUCTION( first_index, second_index, third_index, vector, operation_name, preposition1, preposition2)
 
#define PRINT_RESULT(prefix, action, index, value)
 
#define PRINT_SLICE(first_index, lsb, msb, vector)
 
#define OPERATION_TYPE_SIZE   1
 
#define ELEMENT_SIZE   (sizeof(fr) + 1)
 
#define TWO_IN_ONE_OUT   3
 
#define THREE_IN_ONE_OUT   4
 
#define SLICE_ARGS_SIZE   6
 
#define MONT_CONVERSION
 
#define INV_MONT_CONVERSION
 
#define PUT_RANDOM_BYTE_IF_LUCKY(variable)
 

Typedefs

using fr = bb::fr
 

Functions

int LLVMFuzzerInitialize (int *argc, char ***argv)
 
size_t LLVMFuzzerTestOneInput (const uint8_t *Data, size_t Size)
 Fuzzer entry function.
 

Variables

bool circuit_should_fail = false
 
FastRandom VarianceRNG (0)
 

Macro Definition Documentation

◆ ELEMENT_SIZE

#define ELEMENT_SIZE   (sizeof(fr) + 1)

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

◆ HAVOC_TESTING

#define HAVOC_TESTING

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

◆ INV_MONT_CONVERSION

#define INV_MONT_CONVERSION
Value:
if (convert_to_montgomery) { \
e = fr(value_data).from_montgomery_form(); \
} else { \
e = fr(value_data); \
}
bb::fr fr
BB_INLINE constexpr field from_montgomery_form() const noexcept

◆ MONT_CONVERSION

#define MONT_CONVERSION
Value:
if (convert_to_montgomery) { \
value_data = uint256_t(e.to_montgomery_form()); \
} else { \
value_data = uint256_t(e); \
}

◆ OPERATION_TYPE_SIZE

#define OPERATION_TYPE_SIZE   1

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

◆ PRINT_RESULT

#define PRINT_RESULT (   prefix,
  action,
  index,
  value 
)

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

◆ PRINT_SLICE

#define PRINT_SLICE (   first_index,
  lsb,
  msb,
  vector 
)

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

◆ PRINT_THREE_ARG_INSTRUCTION

#define PRINT_THREE_ARG_INSTRUCTION (   first_index,
  second_index,
  third_index,
  vector,
  operation_name,
  preposition1,
  preposition2 
)

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

◆ PRINT_TWO_ARG_INSTRUCTION

#define PRINT_TWO_ARG_INSTRUCTION (   first_index,
  second_index,
  vector,
  operation_name,
  preposition 
)

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

◆ PRINT_TWO_ARG_ONE_VALUE_INSTRUCTION

#define PRINT_TWO_ARG_ONE_VALUE_INSTRUCTION (   first_index,
  second_index,
  third_index,
  vector,
  operation_name,
  preposition1,
  preposition2 
)

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

◆ PRINT_TWO_ARG_TWO_VALUES_INSTRUCTION

#define PRINT_TWO_ARG_TWO_VALUES_INSTRUCTION (   first_index,
  second_index,
  value1,
  value2,
  vector,
  operation_name,
  preposition1,
  preposition2,
  preposition3 
)

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

◆ PUT_RANDOM_BYTE_IF_LUCKY

#define PUT_RANDOM_BYTE_IF_LUCKY (   variable)
Value:
if (rng.next() & 1) { \
variable = rng.next() & 0xff; \
}

◆ SLICE_ARGS_SIZE

#define SLICE_ARGS_SIZE   6

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

◆ THREE_IN_ONE_OUT

#define THREE_IN_ONE_OUT   4

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

◆ TWO_IN_ONE_OUT

#define TWO_IN_ONE_OUT   3

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

Typedef Documentation

◆ fr

using fr = bb::fr

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

Function Documentation

◆ LLVMFuzzerInitialize()

int LLVMFuzzerInitialize ( int *  argc,
char ***  argv 
)

This is used, when we need to determine the probabilities of various mutations. Left here for posterity

Write mutation settings to log

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

◆ LLVMFuzzerTestOneInput()

size_t LLVMFuzzerTestOneInput ( const uint8_t *  Data,
size_t  Size 
)

Fuzzer entry function.

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

Variable Documentation

◆ circuit_should_fail

bool circuit_should_fail = false

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

◆ VarianceRNG

FastRandom VarianceRNG(0) ( )