Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/FuzzingLabs/cairo-fuzzer
/ functions
Functions
157 in github.com/FuzzingLabs/cairo-fuzzer
⨍
Functions
157
◇
Types & classes
27
↓ 31 callers
Method
rand
(&mut self, min: usize, max: usize)
src/mutator/mutator_felt252.rs:86
↓ 26 callers
Method
gen_range
Generate a random number in the range [start, end]
cairo-native-fuzzer/src/custom_rand/rng.rs:36
↓ 26 callers
Method
insert
Insert `buf` at `offset` in the input. `buf` will be truncated to ensure the input stays within the maximum input size
src/mutator/mutator_felt252.rs:659
↓ 15 callers
Method
rand_exp
(&mut self, min: usize, max: usize)
src/mutator/mutator_felt252.rs:108
↓ 14 callers
Method
rand_offset
Generate a random offset, see `rand_offset_int` for more info
src/mutator/mutator_felt252.rs:418
↓ 8 callers
Method
rand_offset_int
Pick a random offset in the input to corrupt. Any mutation strategy which needs to pick a random byte should us this, such that a bias can be applied
src/mutator/mutator_felt252.rs:398
↓ 6 callers
Method
dump_json
Function to dump the crashes corpus
src/fuzzer/corpus_crash.rs:180
↓ 5 callers
Method
fuzz
Fuzz
src/fuzzer/fuzzer.rs:183
↓ 4 callers
Method
next
(&mut self)
src/mutator/mutator_felt252.rs:75
↓ 4 callers
Method
run
(mut self, data: &Vec<Felt252>)
src/runner/starknet_runner.rs:103
↓ 3 callers
Function
get_abi
(data: &Value)
src/json/json_parser.rs:96
↓ 3 callers
Function
get_function_from_json
(data: &String, function_name: &String)
src/json/json_parser.rs:105
↓ 3 callers
Method
overwrite
Overwrite the bytes in the input with `buf` at `offset`. If `buf` goes out of bounds of the input the `buf` will be truncated and the copy will stop.
src/mutator/mutator_felt252.rs:672
↓ 3 callers
Method
rand_usize
Get a random usize number using xorshift
cairo-native-fuzzer/src/custom_rand/rng.rs:31
↓ 3 callers
Method
replay
Replay a given corpus. If `minimizer` is set to "true" it will dump the new corpus
src/fuzzer/fuzzer.rs:218
↓ 2 callers
Function
extract_function_name
Extracts the function name from the prototype string
test-generator/src/main.rs:46
↓ 2 callers
Function
find_entry_point_id
Find the entry point id
cairo-native-fuzzer/src/fuzzer/utils.rs:132
↓ 2 callers
Method
fuzz
Runs the fuzzer.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:321
↓ 2 callers
Method
get_state
(self)
src/runner/starknet_runner.rs:92
↓ 2 callers
Function
hash_vector
(vector: &[T])
src/fuzzer/utils.rs:4
↓ 2 callers
Method
initialize_parameters
Initializes parameters based on the function argument types.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:223
↓ 2 callers
Method
monitor
Function to print stats of the running fuzzer
src/fuzzer/fuzzer.rs:303
↓ 2 callers
Function
run_program
Execute a program with arbitraty entrypoint & parameters
cairo-native-fuzzer/src/runner/runner.rs:28
↓ 2 callers
Method
set
Randomly replace a sequence of bytes with the same random character repeated a random amount of times
src/mutator/mutator_felt252.rs:563
↓ 2 callers
Method
setup_execution_environment
Sets up the execution environment by compiling the Sierra program and creating a JIT executor.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:230
↓ 1 callers
Method
add_small_random_value
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:48
↓ 1 callers
Method
add_sub
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:120
↓ 1 callers
Function
analyze_json
(data: &String)
src/json/json_parser.rs:125
↓ 1 callers
Method
byte_repeat_insert
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:281
↓ 1 callers
Method
byte_repeat_overwrite
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:267
↓ 1 callers
Function
compile_sierra_program
Compile a Sierra program into a MLIR module
cairo-native-fuzzer/src/runner/runner.rs:18
↓ 1 callers
Method
convert_and_store_cairo_to_sierra
Compile the Cairo program to Sierra
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:137
↓ 1 callers
Function
convert_integer_inputs_to_values
Converts integer inputs to the desired JSON format
test-generator/src/main.rs:104
↓ 1 callers
Method
copy
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:150
↓ 1 callers
Function
create_executor
Create a JIT Native Executor
cairo-native-fuzzer/src/runner/runner.rs:12
↓ 1 callers
Method
dec_byte
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:111
↓ 1 callers
Method
determine_argument_count
Determines the correct number of arguments by iteratively adding parameters and checking for deserialization errors.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:180
↓ 1 callers
Method
execute_program
Executes the program and checks for crashes.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:242
↓ 1 callers
Function
extract_function
(tmp: &serde_json::Map<String, Value>)
src/json/json_parser.rs:17
↓ 1 callers
Method
fix_inputs_types
(&mut self)
src/mutator/mutator_felt252.rs:202
↓ 1 callers
Method
flip_random_bit
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:66
↓ 1 callers
Method
fuzz_proptesting
Fuzzes all functions that finish with "fuzz_*".
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:378
↓ 1 callers
Function
generate_fuzzing_data
Generates the fuzzing data for a given function
test-generator/src/main.rs:81
↓ 1 callers
Method
generate_params
Generates parameters based on the function argument types.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:156
↓ 1 callers
Function
get_cairo_native_version
Return the current cairo-native package version
cairo-native-fuzzer/src/utils.rs:7
↓ 1 callers
Method
get_entry_points
Returns a vector of strings with the entry points
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:306
↓ 1 callers
Function
get_function_argument_types
Returns a vector of the function parameter types For example, given a function with the prototype: ``` myfunction(a: felt252, b: felt252) -> felt252
cairo-native-fuzzer/src/fuzzer/utils.rs:45
↓ 1 callers
Function
get_function_by_id
Find and return the function with the given `FunctionId` in the `Program`
cairo-native-fuzzer/src/utils.rs:13
↓ 1 callers
Method
get_input_by_index
(&self, index: usize)
src/fuzzer/stats.rs:45
↓ 1 callers
Function
get_integers_inputs
Parses the result of generate_test_cases_for_function and returns a vector of vectors of integer inputs
test-generator/src/main.rs:55
↓ 1 callers
Function
get_proptesting_functions
To test before deploying on master
src/json/json_parser.rs:168
↓ 1 callers
Method
inc_byte
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:107
↓ 1 callers
Method
init
Initialize the fuzzer with a given seed - Initializes the mutator with the given seed - Compiles Cairo code to Sierra if needed - Finds the entry poin
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:112
↓ 1 callers
Method
input
(&self, _idx: usize)
src/mutator/mutator_felt252.rs:39
↓ 1 callers
Method
insert_inplace
Take the bytes from `source` for `len` bytes in the input, and insert a copy of them at `dest`
src/mutator/mutator_felt252.rs:688
↓ 1 callers
Method
inter_splice
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:165
↓ 1 callers
Method
magic_insert
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:203
↓ 1 callers
Method
magic_overwrite
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:191
↓ 1 callers
Function
map_argument_type
Helper function to map argument types based on their debug names This function takes a debug name string and returns the corresponding `ArgumentType`
cairo-native-fuzzer/src/mutator/argument_type.rs:10
↓ 1 callers
Method
max_input_size
Sets the maximum input size
src/mutator/mutator_felt252.rs:272
↓ 1 callers
Method
mutate
Performs standard mutation of an the input
src/mutator/mutator_felt252.rs:278
↓ 1 callers
Method
mutate
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:23
↓ 1 callers
Method
mutate_parameters
Mutates the parameters using the mutator.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:274
↓ 1 callers
Method
num_inputs
(&self)
src/mutator/mutator_felt252.rs:36
↓ 1 callers
Method
overwrite_inplace
Take the bytes from `source` for `len` bytes in the input, and copy them to `dest`
src/mutator/mutator_felt252.rs:717
↓ 1 callers
Function
parse_line_inputs
Parses a single line of test cases and returns a vector of integer inputs
test-generator/src/main.rs:64
↓ 1 callers
Function
print_contract_functions
Print the contract functions prototypes
cairo-native-fuzzer/src/fuzzer/utils.rs:77
↓ 1 callers
Function
print_function_names
Prints the names of all available functions in the decompiler
test-generator/src/main.rs:35
↓ 1 callers
Method
print_functions_prototypes
Print the contract functions prototypes
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:131
↓ 1 callers
Function
print_init_message
Print the initialization message
cairo-native-fuzzer/src/fuzzer/utils.rs:22
↓ 1 callers
Method
print_statistics
Prints the statistics every 1000 executions.
cairo-native-fuzzer/src/fuzzer/fuzzer.rs:282
↓ 1 callers
Method
rand
Get a random 64-bit number using xorshift
src/custom_rand/rng.rs:18
↓ 1 callers
Method
rand
Get a random 64-bit number using xorshift
cairo-native-fuzzer/src/custom_rand/rng.rs:21
↓ 1 callers
Method
rand_usize
Get a random usize number using xorshift
src/custom_rand/rng.rs:28
↓ 1 callers
Method
random_insert
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:241
↓ 1 callers
Method
random_overwrite
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:228
↓ 1 callers
Function
search_for_function
(data: &Vec<Value>)
src/json/json_parser.rs:63
↓ 1 callers
Method
seed
Sets the seed for the internal RNG
src/mutator/mutator_felt252.rs:262
↓ 1 callers
Method
set_state
(mut self, state: StateCache)
src/runner/starknet_runner.rs:96
↓ 1 callers
Method
subtract_small_random_value
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:54
↓ 1 callers
Method
swap
Swap two difference sequence of bytes in the input to different places
src/mutator/mutator_felt252.rs:637
↓ 1 callers
Method
swap
(&mut self, felt: Felt)
cairo-native-fuzzer/src/mutator/basic_mutator.rs:135
↓ 1 callers
Method
types
(mut self, types: Vec<String>)
src/mutator/mutator_felt252.rs:267
Method
add_sub
Add or subtract a random amount with a random endianness from a random size `u8` through `u64`
src/mutator/mutator_felt252.rs:496
Method
byte_repeat_insert
Find a byte and repeat it multiple times by splicing a random amount of the byte in
src/mutator/mutator_felt252.rs:869
Method
byte_repeat_overwrite
Find a byte and repeat it multiple times by overwriting the data after it
src/mutator/mutator_felt252.rs:848
Method
call_contract
( &mut self, address: Felt, entry_point_selector: Felt, calldata: &[Felt],
cairo-native-fuzzer/src/runner/syscall_handler.rs:120
Method
copy
location in the input
src/mutator/mutator_felt252.rs:746
Method
default
()
cairo-native-fuzzer/src/fuzzer/statistics.rs:14
Method
deploy
( &mut self, class_hash: Felt, contract_address_salt: Felt, calldata: &[Felt],
cairo-native-fuzzer/src/runner/syscall_handler.rs:87
Method
dump_json
Function to dump the inputs corpus
src/fuzzer/corpus_input.rs:179
Method
emit_event
(&mut self, keys: &[Felt], data: &[Felt], _gas: &mut u64)
cairo-native-fuzzer/src/runner/syscall_handler.rs:154
Method
expand
Make space in the input, filling with zeros if `printable` is not set, and if it is set, then fill with spaces.
src/mutator/mutator_felt252.rs:461
Method
fuzz
(self)
src/fuzzer/starknet_worker.rs:49
Method
get_block_hash
(&mut self, block_number: u64, _gas: &mut u64)
cairo-native-fuzzer/src/runner/syscall_handler.rs:20
Method
get_class_hash_at
( &mut self, _contract_address: Felt, _remaining_gas: &mut u64, )
cairo-native-fuzzer/src/runner/syscall_handler.rs:278
Method
get_execution_info
( &mut self, _gas: &mut u64, )
cairo-native-fuzzer/src/runner/syscall_handler.rs:25
Method
get_execution_info_v2
( &mut self, _remaining_gas: &mut u64, )
cairo-native-fuzzer/src/runner/syscall_handler.rs:51
Method
insert_rand
Create 1 or 2 random bytes and insert them into the input
src/mutator/mutator_felt252.rs:785
Method
inter_splice
Take one location of the input and splice it into another
src/mutator/mutator_felt252.rs:766
next →
1–100 of 157, ranked by callers