diff --git a/crypto/blake2b/blake2b_f_fuzz.go b/crypto/blake2b/blake2b_f_fuzz.go index b2f4057074..aa124c1f40 100644 --- a/crypto/blake2b/blake2b_f_fuzz.go +++ b/crypto/blake2b/blake2b_f_fuzz.go @@ -1,13 +1,10 @@ -//go:build gofuzz -// +build gofuzz - package blake2b import ( "encoding/binary" ) -func Fuzz(data []byte) int { +func fuzz(data []byte) int { // Make sure the data confirms to the input model if len(data) != 211 { return 0 diff --git a/crypto/blake2b/blake2b_f_test.go b/crypto/blake2b/blake2b_f_test.go index 4e07d131cd..16dbb3e56d 100644 --- a/crypto/blake2b/blake2b_f_test.go +++ b/crypto/blake2b/blake2b_f_test.go @@ -6,6 +6,12 @@ import ( "testing" ) +func Fuzz(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzz(data) + }) +} + func TestF(t *testing.T) { for i, test := range testVectorsF { t.Run(fmt.Sprintf("test vector %v", i), func(t *testing.T) { diff --git a/oss-fuzz.sh b/oss-fuzz.sh index f70fc92748..c069b4bc58 100644 --- a/oss-fuzz.sh +++ b/oss-fuzz.sh @@ -62,7 +62,7 @@ compile_fuzzer tests/fuzzers/bn256 FuzzMul fuzzBn256Mul compile_fuzzer tests/fuzzers/bn256 FuzzPair fuzzBn256Pair compile_fuzzer tests/fuzzers/runtime Fuzz fuzzVmRuntime compile_fuzzer tests/fuzzers/keystore Fuzz fuzzKeystore -compile_fuzzer tests/fuzzers/txfetcher FuzzFetcher fuzzTxfetcher +compile_fuzzer tests/fuzzers/txfetcher Fuzz fuzzTxfetcher compile_fuzzer tests/fuzzers/rlp Fuzz fuzzRlp compile_fuzzer tests/fuzzers/trie Fuzz fuzzTrie compile_fuzzer tests/fuzzers/stacktrie Fuzz fuzzStackTrie diff --git a/tests/fuzzers/txfetcher/txfetcher_test.go b/tests/fuzzers/txfetcher/txfetcher_test.go index a7d28a806e..ac2e6b1c67 100644 --- a/tests/fuzzers/txfetcher/txfetcher_test.go +++ b/tests/fuzzers/txfetcher/txfetcher_test.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . -package trie +package txfetcher import "testing"