c-kzg-4844/fuzz/base_fuzz.h
Justin Traglia 7d170f9939
Add coverage-guided C fuzzers (#203)
* Start to add fuzzers

* Update path to trusted setup in gen_corpus

* Update path one more time

* Add support for two more targets

* Add fuzzers for remaining targets

* Clean up a little

* Add README

* Fix typos

* De-dup fuzzing files

* Add newline at the end of base_fuzz

* Make generic rule for displaying targets

* Use regular make command

* Remove duplicate targets

* Update .gitignore file
2023-03-13 12:45:02 +02:00

35 lines
930 B
C

/*
* This file contains fuzzing tests for C-KZG-4844.
*/
#pragma once
#include "../src/c_kzg_4844.c"
///////////////////////////////////////////////////////////////////////////////
// Globals
///////////////////////////////////////////////////////////////////////////////
KZGSettings s;
///////////////////////////////////////////////////////////////////////////////
// Trusted setup configuration
///////////////////////////////////////////////////////////////////////////////
static void initialize(void) {
static bool initialized = false;
if (!initialized) {
FILE *fp;
C_KZG_RET ret;
/* Open the mainnet trusted setup file */
fp = fopen("../src/trusted_setup.txt", "r");
assert(fp != NULL);
/* Load that trusted setup file */
ret = load_trusted_setup_file(&s, fp);
assert(ret == C_KZG_OK);
fclose(fp);
initialized = true;
}
}