gmsm/internal/sm2ec/fiat/fiat_test.go

26 lines
399 B
Go
Raw Normal View History

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)
}
}