Rizin
unix-like reverse engineering framework and cli tools
|
#include "fuzz.h"
#include "xxhash.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "lz4.c"
Go to the source code of this file.
Macros | |
#define | LZ4_COMMONDEFS_ONLY |
#define | MIN(a, b) ( (a) < (b) ? (a) : (b) ) |
#define | MAX(a, b) ( (a) > (b) ? (a) : (b) ) |
#define | FUZZ_QUOTE_IMPL(str) #str |
#define | FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str) |
#define | FUZZ_ASSERT_MSG(cond, msg) |
#define | FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), ""); |
#define | FUZZ_STATIC static |
#define | FUZZ_rotl32(x, r) (((x) << (r)) | ((x) >> (32 - (r)))) |
Functions | |
FUZZ_STATIC uint32_t | FUZZ_seed (uint8_t const **src, size_t *size) |
FUZZ_STATIC uint32_t | FUZZ_rand (uint32_t *state) |
FUZZ_STATIC uint32_t | FUZZ_rand32 (uint32_t *state, uint32_t min, uint32_t max) |
#define FUZZ_ASSERT | ( | cond | ) | FUZZ_ASSERT_MSG((cond), ""); |
Definition at line 46 of file fuzz_helpers.h.
Asserts for fuzzing that are always enabled.
Definition at line 41 of file fuzz_helpers.h.
#define FUZZ_QUOTE | ( | str | ) | FUZZ_QUOTE_IMPL(str) |
Definition at line 36 of file fuzz_helpers.h.
Definition at line 35 of file fuzz_helpers.h.
Definition at line 71 of file fuzz_helpers.h.
#define FUZZ_STATIC static |
Definition at line 56 of file fuzz_helpers.h.
#define LZ4_COMMONDEFS_ONLY |
Helper functions for fuzzing.
Definition at line 27 of file fuzz_helpers.h.
FUZZ_STATIC uint32_t FUZZ_rand | ( | uint32_t * | state | ) |
Definition at line 73 of file fuzz_helpers.h.
References FUZZ_rotl32, prime1, and prime2.
Referenced by FUZZ_rand32().
FUZZ_STATIC uint32_t FUZZ_rand32 | ( | uint32_t * | state, |
uint32_t | min, | ||
uint32_t | max | ||
) |
Definition at line 85 of file fuzz_helpers.h.
References FUZZ_rand(), max, and min.
Referenced by FUZZ_randomFrameInfo(), FUZZ_randomPreferences(), state_extDictHCRoundTrip(), state_extDictRoundTrip(), state_prefixHCRoundTrip(), state_prefixRoundTrip(), state_randomRoundTrip(), state_reset(), and state_trimDict().
FUZZ_STATIC uint32_t FUZZ_seed | ( | uint8_t const ** | src, |
size_t * | size | ||
) |
Deterministically constructs a seed based on the fuzz input. Consumes up to the first FUZZ_RNG_SEED_SIZE bytes of the input.
Definition at line 63 of file fuzz_helpers.h.
References FUZZ_RNG_SEED_SIZE, MIN, src, and XXH32().
Referenced by LLVMFuzzerTestOneInput().