summaryrefslogtreecommitdiff
path: root/libgo/go/crypto/elliptic/elliptic_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/crypto/elliptic/elliptic_test.go')
-rw-r--r--libgo/go/crypto/elliptic/elliptic_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/libgo/go/crypto/elliptic/elliptic_test.go b/libgo/go/crypto/elliptic/elliptic_test.go
index 7e27913dcd0..7f3f1a21187 100644
--- a/libgo/go/crypto/elliptic/elliptic_test.go
+++ b/libgo/go/crypto/elliptic/elliptic_test.go
@@ -441,6 +441,18 @@ func BenchmarkBaseMultP256(b *testing.B) {
}
}
+func BenchmarkScalarMultP256(b *testing.B) {
+ b.ResetTimer()
+ p256 := P256()
+ _, x, y, _ := GenerateKey(p256, rand.Reader)
+ priv, _, _, _ := GenerateKey(p256, rand.Reader)
+
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ p256.ScalarMult(x, y, priv)
+ }
+}
+
func TestMarshal(t *testing.T) {
p224 := P224()
_, x, y, err := GenerateKey(p224, rand.Reader)