Skip to content

Commit c956eba

Browse files
authored
test(benchmark): hoist slice allocations in bls pairing (#160)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent ec5489c commit c956eba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/crypto_bench_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ func BenchmarkDirectCrypto(b *testing.B) {
108108
b.Run("BLS_Pairing", func(b *testing.B) {
109109
g1, _ := bls.HashToG1(message, dst)
110110
g2, _ := bls.HashToG2([]byte("another message"), dst)
111+
g1s := []bls.G1Affine{g1}
112+
g2s := []bls.G2Affine{g2}
111113
b.ResetTimer()
112114
for b.Loop() {
113-
bls.Pair([]bls.G1Affine{g1}, []bls.G2Affine{g2})
115+
bls.Pair(g1s, g2s)
114116
}
115117
})
116118
}

0 commit comments

Comments
 (0)