(b *testing.B)
| 23 | var result *rsa.PrivateKey |
| 24 | |
| 25 | func BenchmarkGenerateDeterministicKey(b *testing.B) { |
| 26 | var r *rsa.PrivateKey |
| 27 | |
| 28 | for range b.N { |
| 29 | // always record the result of DeterministicPrivateKey to prevent |
| 30 | // the compiler eliminating the function call. |
| 31 | // #nosec G404 - Using math/rand is acceptable for benchmarking deterministic keys |
| 32 | r = agentrsa.GenerateDeterministicKey(rand.Int64()) |
| 33 | } |
| 34 | |
| 35 | // always store the result to a package level variable |
| 36 | // so the compiler cannot eliminate the Benchmark itself. |
| 37 | result = r |
| 38 | } |
| 39 | |
| 40 | func FuzzGenerateDeterministicKey(f *testing.F) { |
| 41 | testcases := []int64{0, 1234, 1010101010} |
nothing calls this directly
no test coverage detected