mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
30 lines
602 B
Go
30 lines
602 B
Go
// Copyright (C) 2020-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package localsigner
|
|
|
|
import (
|
|
"strconv"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/luxfi/crypto"
|
|
"github.com/luxfi/crypto/bls/blstest"
|
|
)
|
|
|
|
func BenchmarkSign(b *testing.B) {
|
|
signer := NewSigner(require.New(b))
|
|
for _, messageSize := range blstest.BenchmarkSizes {
|
|
b.Run(strconv.Itoa(messageSize), func(b *testing.B) {
|
|
message := crypto.RandomBytes(messageSize)
|
|
|
|
b.ResetTimer()
|
|
|
|
for n := 0; n < b.N; n++ {
|
|
_, _ = signer.Sign(message)
|
|
}
|
|
})
|
|
}
|
|
}
|