...

Source file src/github.com/decred/dcrd/dcrec/secp256k1/v4/privkey_bench_test.go

Documentation: github.com/decred/dcrd/dcrec/secp256k1/v4

     1  // Copyright (c) 2022 The Decred developers
     2  // Use of this source code is governed by an ISC
     3  // license that can be found in the LICENSE file.
     4  
     5  package secp256k1
     6  
     7  import (
     8  	"testing"
     9  )
    10  
    11  // BenchmarkPrivateKeyGenerate benchmarks generating new cryptographically
    12  // secure private keys.
    13  func BenchmarkPrivateKeyGenerate(b *testing.B) {
    14  	b.ReportAllocs()
    15  	b.ResetTimer()
    16  	for i := 0; i < b.N; i++ {
    17  		_, err := GeneratePrivateKey()
    18  		if err != nil {
    19  			b.Fatal(err)
    20  		}
    21  	}
    22  }
    23  

View as plain text