Skip to content

Commit

Permalink
Added fuzzers to some sign packages
Browse files Browse the repository at this point in the history
  • Loading branch information
matteosz committed Mar 16, 2024
1 parent f242994 commit 8f0aa7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion sign/cosi/cosi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var testSuite = &cosiSuite{edwards25519.NewBlakeSHA256Ed25519(), blake2xb.New(ni
func TestCoSi(t *testing.T) {
message := []byte("Hello World Cosi")
testCoSi(t, 2, 0, message)
testCoSi(t, 2, 0, message)
testCoSi(t, 5, 0, message)
testCoSi(t, 5, 2, message)
testCoSi(t, 5, 4, message)
Expand Down
6 changes: 3 additions & 3 deletions sign/schnorr/schnorr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ func TestSchnorrMalleability(t *testing.T) {
}

func FuzzSchnorr(f *testing.F) {
suite := edwards25519.NewBlakeSHA256Ed25519()
kp := key.NewKeyPair(suite)

f.Fuzz(func(t *testing.T, msg []byte) {
if (len(msg) < 1) || (len(msg) > 1000) {
t.Skip("msg must have byte length between 1 and 1000")
}
suite := edwards25519.NewBlakeSHA256Ed25519()
kp := key.NewKeyPair(suite)

s, err := Sign(suite, kp.Private, msg)
require.NoError(t, err, "Couldn't sign msg: %s: %v", msg, err)

Expand Down

0 comments on commit 8f0aa7c

Please sign in to comment.