github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/tm2/pkg/crypto/secp256k1/bench_test.go (about) 1 package secp256k1 2 3 import ( 4 "io" 5 "testing" 6 7 "github.com/gnolang/gno/tm2/pkg/crypto" 8 "github.com/gnolang/gno/tm2/pkg/crypto/internal/benchmarking" 9 ) 10 11 func BenchmarkKeyGeneration(b *testing.B) { 12 b.Skip("too slow (more than 30 mins)") 13 14 benchmarkKeygenWrapper := func(reader io.Reader) crypto.PrivKey { 15 return genPrivKey(reader) 16 } 17 benchmarking.BenchmarkKeyGeneration(b, benchmarkKeygenWrapper) 18 } 19 20 func BenchmarkSigning(b *testing.B) { 21 priv := GenPrivKey() 22 benchmarking.BenchmarkSigning(b, priv) 23 } 24 25 func BenchmarkVerification(b *testing.B) { 26 priv := GenPrivKey() 27 benchmarking.BenchmarkVerification(b, priv) 28 }