Rizin
unix-like reverse engineering framework and cli tools
|
#include "platform.h"
#include "util.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
Go to the source code of this file.
Macros | |
#define | KB *(1 <<10) |
#define | PRIME1 2654435761U |
#define | PRIME2 2246822519U |
#define | LTLOG 13 |
#define | LTSIZE (1<<LTLOG) |
#define | LTMASK (LTSIZE-1) |
#define | MIN(a, b) ( (a) < (b) ? (a) :(b) ) |
#define | RDG_rotl32(x, r) ((x << r) | (x >> (32 - r))) |
#define | RDG_DICTSIZE (32 KB) |
#define | RDG_RAND15BITS ((RDG_rand(seed) >> 3) & 32767) |
#define | RDG_RANDLENGTH ( ((RDG_rand(seed) >> 7) & 7) ? (RDG_rand(seed) & 15) : (RDG_rand(seed) & 511) + 15) |
#define | RDG_BLOCKSIZE (128 KB) |
Typedefs | |
typedef BYTE | litDistribTable[LTSIZE] |
Functions | |
static unsigned int | RDG_rand (U32 *src) |
static void | RDG_fillLiteralDistrib (litDistribTable lt, double ld) |
static BYTE | RDG_genChar (U32 *seed, const litDistribTable lt) |
void | RDG_genBlock (void *buffer, size_t buffSize, size_t prefixSize, double matchProba, litDistribTable lt, unsigned *seedPtr) |
void | RDG_genBuffer (void *buffer, size_t size, double matchProba, double litProba, unsigned seed) |
void | RDG_genOut (unsigned long long size, double matchProba, double litProba, unsigned seed) |
|
static |
Definition at line 72 of file datagen.c.
References assert(), test_evm::end, lastChar(), lt, LTSIZE, MIN, and U32.
Referenced by RDG_genBuffer(), and RDG_genOut().
void RDG_genBlock | ( | void * | buffer, |
size_t | buffSize, | ||
size_t | prefixSize, | ||
double | matchProba, | ||
litDistribTable | lt, | ||
unsigned * | seedPtr | ||
) |
Definition at line 102 of file datagen.c.
References d, length, lt, match, memset(), pos, RDG_genChar(), RDG_rand(), RDG_RAND15BITS, RDG_RANDLENGTH, and U32.
Referenced by RDG_genBuffer(), and RDG_genOut().
void RDG_genBuffer | ( | void * | buffer, |
size_t | size, | ||
double | matchProba, | ||
double | litProba, | ||
unsigned | seed | ||
) |
Definition at line 155 of file datagen.c.
References lt, RDG_fillLiteralDistrib(), and RDG_genBlock().
Referenced by BMK_benchMem(), and BMK_syntheticTest().
|
static |
Definition at line 92 of file datagen.c.
References lt, LTMASK, and RDG_rand().
Referenced by RDG_genBlock().
Definition at line 165 of file datagen.c.
References lt, memcpy(), RDG_BLOCKSIZE, RDG_DICTSIZE, RDG_fillLiteralDistrib(), RDG_genBlock(), and SET_BINARY_MODE.
Referenced by main().
Definition at line 61 of file datagen.c.
References PRIME1, PRIME2, RDG_rotl32, and src.
Referenced by RDG_genBlock(), and RDG_genChar().