Skip to content

Commit 1d83015

Browse files
committed
Fix baseline
Signed-off-by: Alessandro Sorniotti <aso@zurich.ibm.com>
1 parent ffa1291 commit 1d83015

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

perf_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,27 @@ func Benchmark_PedersenCommitmentPoKKilic(b *testing.B) {
102102
rng, g, h, x := pokPedersenCommittmentInitKilic(b)
103103
_g := kilic.NewG1()
104104
tmp := _g.New()
105+
mod := fr.Modulus()
105106

106107
b.ResetTimer()
107108

108109
b.Run("curve BLS12_381 (direct)", func(b *testing.B) {
109110

110111
for i := 0; i < b.N; i++ {
111-
r := newRandZr(rng, fr.Modulus())
112+
r := newRandZr(rng, mod)
112113
c := _g.New()
113114
_g.MulScalarBig(c, g, x)
114115
_g.MulScalarBig(tmp, h, r)
115116
_g.Add(c, c, tmp)
116117

117-
x_tilde := newRandZr(rng, fr.Modulus())
118-
r_tilde := newRandZr(rng, fr.Modulus())
118+
x_tilde := newRandZr(rng, mod)
119+
r_tilde := newRandZr(rng, mod)
119120
t := _g.New()
120121
_g.MulScalarBig(t, g, x_tilde)
121122
_g.MulScalarBig(tmp, h, r_tilde)
122123
_g.Add(t, t, tmp)
123124

124-
chal := newRandZr(rng, fr.Modulus())
125+
chal := newRandZr(rng, mod)
125126

126127
x_hat := new(big.Int).Add(x_tilde, new(big.Int).Mul(chal, x))
127128
r_hat := new(big.Int).Add(r_tilde, new(big.Int).Mul(chal, r))

0 commit comments

Comments
 (0)