func runGetFirstAKSWitnessBenchmark(b *testing.B, numDigits int64) {
	b.StopTimer()
	n := getFirstPrimeWithDigits(numDigits)
	r := CalculateAKSModulus(n)
	M := big.NewInt(10)
	b.StartTimer()
	for i := 0; i < b.N; i++ {
		getFirstAKSWitness(n, r, M, nullLogger)
	}
}
Benchmark getFirstAKSWitness for the first prime number of the
given number of decimal digits.
package aks
import "io/ioutil"
import "log"
import "math/big"
import "runtime"
import "testing"
const _NUM_PROBABLY_PRIME_ROUNDS = 10
func getFirstPrimeWithDigits(numDigits int64) *big.Int {
	one := big.NewInt(1)
	n := big.NewInt(10)
	n.Exp(n, big.NewInt(numDigits), nil)
	for !n.ProbablyPrime(_NUM_PROBABLY_PRIME_ROUNDS) {
		n.Add(n, one)
	}
	return n
}
func runIsAKSWitnessBenchmark(b *testing.B, numDigits int64) {
	b.StopTimer()
	n := getFirstPrimeWithDigits(numDigits)
	r := CalculateAKSModulus(n)
	a := big.NewInt(2)
	tmp1 := newBigIntPoly(*n, *r)
	tmp2 := newBigIntPoly(*n, *r)
	tmp3 := newBigIntPoly(*n, *r)
	b.StartTimer()
	for i := 0; i < b.N; i++ {
		isAKSWitness(*n, *a, tmp1, tmp2, tmp3)
	}
}
func BenchmarkIsAKSWitness3Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 3)
}
func BenchmarkIsAKSWitness4Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 4)
}
func BenchmarkIsAKSWitness5Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 5)
}
func BenchmarkIsAKSWitness6Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 6)
}
func BenchmarkIsAKSWitness7Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 7)
}
func BenchmarkIsAKSWitness8Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 8)
}
func BenchmarkIsAKSWitnessMax32(b *testing.B) {
	b.StopTimer()
	n := big.NewInt(4294967291)
	r := CalculateAKSModulus(n)
	a := big.NewInt(2)
	tmp1 := newBigIntPoly(*n, *r)
	tmp2 := newBigIntPoly(*n, *r)
	tmp3 := newBigIntPoly(*n, *r)
	b.StartTimer()
	for i := 0; i < b.N; i++ {
		isAKSWitness(*n, *a, tmp1, tmp2, tmp3)
	}
}
func BenchmarkIsAKSWitness9Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 9)
}
func BenchmarkIsAKSWitness10Digits(b *testing.B) {
	runIsAKSWitnessBenchmark(b, 10)
}
var nullLogger *log.Logger = log.New(ioutil.Discard, "", 0)