From 48cd33e62d031c5da7886590711a1351096150b2 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Fri, 6 Jan 2023 17:38:11 -0500 Subject: [PATCH 1/2] test --- crypto/bls12381/g1_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/bls12381/g1_test.go b/crypto/bls12381/g1_test.go index eef9f4505583..81c9181d1a1e 100644 --- a/crypto/bls12381/g1_test.go +++ b/crypto/bls12381/g1_test.go @@ -262,8 +262,9 @@ func BenchmarkG1Add(t *testing.B) { } func BenchmarkG1Mul(t *testing.B) { + worstCaseScalar, _ := new(big.Int).SetString("57896044618658097711785492504343953926634992332820282019728792003956564819967", 10) g1 := NewG1() - a, e, c := g1.rand(), q, PointG1{} + a, e, c := g1.rand(), worstCaseScalar, PointG1{} t.ResetTimer() for i := 0; i < t.N; i++ { g1.MulScalar(&c, a, e) From 17ed09e0d020a070bba17b5a6c215258390acb5d Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Fri, 6 Jan 2023 17:46:35 -0500 Subject: [PATCH 2/2] crypto/bls12381: use worst case scalar for input to G1/G2 mul benchmarks --- crypto/bls12381/g1_test.go | 2 +- crypto/bls12381/g2_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/bls12381/g1_test.go b/crypto/bls12381/g1_test.go index 81c9181d1a1e..87140459fbc5 100644 --- a/crypto/bls12381/g1_test.go +++ b/crypto/bls12381/g1_test.go @@ -262,7 +262,7 @@ func BenchmarkG1Add(t *testing.B) { } func BenchmarkG1Mul(t *testing.B) { - worstCaseScalar, _ := new(big.Int).SetString("57896044618658097711785492504343953926634992332820282019728792003956564819967", 10) + worstCaseScalar, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) g1 := NewG1() a, e, c := g1.rand(), worstCaseScalar, PointG1{} t.ResetTimer() diff --git a/crypto/bls12381/g2_test.go b/crypto/bls12381/g2_test.go index f16f0e5eea72..4d1f3a19ac67 100644 --- a/crypto/bls12381/g2_test.go +++ b/crypto/bls12381/g2_test.go @@ -265,8 +265,9 @@ func BenchmarkG2Add(t *testing.B) { } func BenchmarkG2Mul(t *testing.B) { + worstCaseScalar, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) g2 := NewG2() - a, e, c := g2.rand(), q, PointG2{} + a, e, c := g2.rand(), worstCaseScalar, PointG2{} t.ResetTimer() for i := 0; i < t.N; i++ { g2.MulScalar(&c, a, e)