github.com/emmansun/gmsm@v0.29.1/internal/sm2ec/fiat/fiat_test.go (about) 1 package fiat_test 2 3 import ( 4 "testing" 5 6 "github.com/emmansun/gmsm/internal/sm2ec/fiat" 7 ) 8 9 func BenchmarkMul(b *testing.B) { 10 v := new(fiat.SM2P256Element).One() 11 b.ReportAllocs() 12 b.ResetTimer() 13 for i := 0; i < b.N; i++ { 14 v.Mul(v, v) 15 } 16 } 17 18 func BenchmarkSquare(b *testing.B) { 19 v := new(fiat.SM2P256Element).One() 20 b.ReportAllocs() 21 b.ResetTimer() 22 for i := 0; i < b.N; i++ { 23 v.Square(v) 24 } 25 }