mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-01-11 10:44:23 +00:00
7d170f9939
* 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
22 lines
556 B
C
22 lines
556 B
C
#include "../base_fuzz.h"
|
|
|
|
static const size_t BLOB_OFFSET = 0;
|
|
static const size_t Z_OFFSET = BLOB_OFFSET + BYTES_PER_BLOB;
|
|
static const size_t INPUT_SIZE = Z_OFFSET + BYTES_PER_FIELD_ELEMENT;
|
|
|
|
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|
initialize();
|
|
if (size == INPUT_SIZE) {
|
|
KZGProof proof;
|
|
Bytes32 y;
|
|
compute_kzg_proof(
|
|
&proof,
|
|
&y,
|
|
(const Blob *)(data + BLOB_OFFSET),
|
|
(const Bytes32 *)(data + Z_OFFSET),
|
|
&s
|
|
);
|
|
}
|
|
return 0;
|
|
}
|