Skip to content

Commit

Permalink
Remove unused param
Browse files Browse the repository at this point in the history
  • Loading branch information
K1li4nL committed Aug 19, 2024
1 parent fbbb53b commit d1254d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,16 @@ func benchmarkSign(sigType string) map[string]interface{} {
// Signing
for _, i := range keys {
results["sign"][fmt.Sprintf("%d", i)] = testing.Benchmark(func(b *testing.B) {
_, scheme, _, privates, _, _ := test.PrepareBLS(i)
scheme, _, privates, _, _ := test.PrepareBLS(i)
test.BenchSign(b, scheme, benchMessage, privates)
})
}

// Verification
for _, i := range keys {
results["verify"][fmt.Sprintf("%d", i)] = testing.Benchmark(func(b *testing.B) {
suite, scheme, publics, _, msgs, sigs := test.PrepareBLS(i)
test.BLSBenchVerify(b, sigs, scheme, suite, publics, msgs)
scheme, publics, _, msgs, sigs := test.PrepareBLS(i)
test.BLSBenchVerify(b, sigs, scheme, publics, msgs)
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions util/test/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"go.dedis.ch/kyber/v4/util/random"
)

func PrepareBLS(numSigs int) (suite *bn256.Suite, scheme sign.Scheme,
func PrepareBLS(numSigs int) (scheme sign.Scheme,
publics []kyber.Point, privates []kyber.Scalar, msgs [][]byte, sigs [][]byte) {
suite = bn256.NewSuite()
suite := bn256.NewSuite()
scheme = bls.NewSchemeOnG1(suite)

publics = make([]kyber.Point, numSigs)
Expand All @@ -37,7 +37,7 @@ func PrepareBLS(numSigs int) (suite *bn256.Suite, scheme sign.Scheme,
}
sigs[i] = sig
}
return suite, scheme, publics, privates, msgs, sigs
return scheme, publics, privates, msgs, sigs
}

func BenchCreateKeys(b *testing.B, scheme sign.Scheme, n int) {
Expand All @@ -60,7 +60,7 @@ func BenchSign(b *testing.B, scheme sign.Scheme, msg []byte, privates []kyber.Sc
}

func BLSBenchVerify(b *testing.B, sigs [][]byte, scheme sign.Scheme,
suite *bn256.Suite, publics []kyber.Point, msgs [][]byte) {
publics []kyber.Point, msgs [][]byte) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
for _, p := range publics {
Expand Down

0 comments on commit d1254d5

Please sign in to comment.