Current version (20 iterations of ProbablyPrime
):
$ go test -run none -bench=. -benchtime=60s
PASS
BenchmarkRSA2048Validate 1000 137668985 ns/op
...
Fewer (2) iterations of ProbablyPrime
:
$ go test -run none -bench=. -benchtime=15s
PASS
BenchmarkRSA2048Validate 2000 14034241 ns/op
...
Dropping the ProbablyPrime
check entirely:
$ go test -run none -bench=. -benchtime=1s
PASS
BenchmarkRSA2048Validate 200000 7835 ns/op
...
The benchmark code (key lifted from neighboring
BenchmarkRSA2048Decrypt
):