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

Go to the source code of this file.

Classes

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

Macros

#define MAX_ARRAY_SIZE   128
 
#define HAVOC_TESTING
 
#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 PUT_RANDOM_BYTE_IF_LUCKY(variable)
 
#define PUT_RANDOM_TWO_BYTES_IF_LUCKY(variable)
 
#define PUT_RANDOM_FOUR_BYTES_IF_LUCKY(variable)
 

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 46 of file byte_array.fuzzer.hpp.

◆ HAVOC_TESTING

#define HAVOC_TESTING

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

◆ MAX_ARRAY_SIZE

#define MAX_ARRAY_SIZE   128

Definition at line 13 of file byte_array.fuzzer.hpp.

◆ OPERATION_TYPE_SIZE

#define OPERATION_TYPE_SIZE   1

Definition at line 44 of file byte_array.fuzzer.hpp.

◆ PUT_RANDOM_BYTE_IF_LUCKY

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

◆ PUT_RANDOM_FOUR_BYTES_IF_LUCKY

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

◆ PUT_RANDOM_TWO_BYTES_IF_LUCKY

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

◆ SLICE_ARGS_SIZE

#define SLICE_ARGS_SIZE   6

Definition at line 49 of file byte_array.fuzzer.hpp.

◆ THREE_IN_ONE_OUT

#define THREE_IN_ONE_OUT   4

Definition at line 48 of file byte_array.fuzzer.hpp.

◆ TWO_IN_ONE_OUT

#define TWO_IN_ONE_OUT   3

Definition at line 47 of file byte_array.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 797 of file byte_array.fuzzer.hpp.

◆ LLVMFuzzerTestOneInput()

size_t LLVMFuzzerTestOneInput ( const uint8_t *  Data,
size_t  Size 
)

Fuzzer entry function.

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

Variable Documentation

◆ circuit_should_fail

bool circuit_should_fail = false

Definition at line 17 of file byte_array.fuzzer.hpp.

◆ VarianceRNG

FastRandom VarianceRNG(0) ( )