diff options
Diffstat (limited to 'tests/fuzz/api/scrypt.go')
-rw-r--r-- | tests/fuzz/api/scrypt.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/fuzz/api/scrypt.go b/tests/fuzz/api/scrypt.go new file mode 100644 index 0000000..eb29d2d --- /dev/null +++ b/tests/fuzz/api/scrypt.go @@ -0,0 +1,37 @@ +package scrypt + +import ( + "os" + "testing" + "testing/internal/testdeps" +) + + + +func api(f *testing.F) { + f.Fuzz(func(t *testing.T, password []byte, salt []byte) { + if len(salt) < saltMinLength { + return + } + + _, err := Hash(password, salt) + if err != nil { + t.Errorf("Failed on: %#v\n", err) + } + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "api", api }, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} |