Skip to content

Commit

Permalink
Properly use masks + fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
K1li4nL committed Sep 2, 2024
1 parent d1254d5 commit bd7268d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pairing/bls12381/bls12381_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,22 +734,27 @@ func BDNBenchmark(b *testing.B, curveOption string) {
}

// Prepare masks for aggregation
maskG1, err := sign.NewMask(pubKeysOnG1, pubKeysOnG1[0])
maskG1, err := sign.NewMask(pubKeysOnG1, nil)
if err != nil {
panic(err)
}
maskG2, err := sign.NewMask(pubKeysOnG2, pubKeysOnG2[0])
maskG2, err := sign.NewMask(pubKeysOnG2, nil)
if err != nil {
panic(err)
}

for _, n := range numSigs {
for i := 0; i < n; i++ {
maskG1.SetBit(i, true)
maskG2.SetBit(i, true)
}

// Benchmark aggregation of public keys
b.Run(fmt.Sprintf("AggregatePublicKeys-G1 on %d signs", n), func(bb *testing.B) {
for j := 0; j < bb.N; j++ {
result, err = schemeOnG1.AggregatePublicKeys(maskG1)
if err != nil {
panic(err)
require.NoError(b, err)
}
}
})
Expand All @@ -771,7 +776,7 @@ func BDNBenchmark(b *testing.B, curveOption string) {
}
}
})
b.Run(fmt.Sprintf("AggregateSign-G1 on %d signs", n), func(bb *testing.B) {
b.Run(fmt.Sprintf("AggregateSign-G2 on %d signs", n), func(bb *testing.B) {
for j := 0; j < bb.N; j++ {
result, err = schemeOnG2.AggregateSignatures(sigsOnG2[:n], maskG2)
if err != nil {
Expand Down

0 comments on commit bd7268d

Please sign in to comment.