mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-25 11:46:19 +08:00
26 lines
399 B
Go
26 lines
399 B
Go
package fiat_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/emmansun/gmsm/internal/sm2ec/fiat"
|
|
)
|
|
|
|
func BenchmarkMul(b *testing.B) {
|
|
v := new(fiat.SM2P256Element).One()
|
|
b.ReportAllocs()
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
v.Mul(v, v)
|
|
}
|
|
}
|
|
|
|
func BenchmarkSquare(b *testing.B) {
|
|
v := new(fiat.SM2P256Element).One()
|
|
b.ReportAllocs()
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
v.Square(v)
|
|
}
|
|
}
|