cosmos-sdk/crypto/keys/secp256k1/bench_test.go
Carlos Santiago Yanzon b6f9c705f7
feat: secp256k1 public key constant time (#18026)
Signed-off-by: bizk <santiago.yanzon1999@gmail.com>
2023-12-04 19:04:02 +00:00

31 lines
661 B
Go

package secp256k1
import (
"io"
"testing"
"github.com/cosmos/cosmos-sdk/crypto/keys/internal/benchmarking"
"github.com/cosmos/cosmos-sdk/crypto/types"
)
func BenchmarkKeyGeneration(b *testing.B) {
b.ReportAllocs()
benchmarkKeygenWrapper := func(reader io.Reader) types.PrivKey {
priv := genPrivKey()
return &PrivKey{Key: priv}
}
benchmarking.BenchmarkKeyGeneration(b, benchmarkKeygenWrapper)
}
func BenchmarkSigning(b *testing.B) {
b.ReportAllocs()
priv := GenPrivKey()
benchmarking.BenchmarkSigning(b, priv)
}
func BenchmarkVerification(b *testing.B) {
b.ReportAllocs()
priv := GenPrivKey()
benchmarking.BenchmarkVerification(b, priv)
}