You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ProbablyPrime function in math/big filters out multiples of small odd primes before performing the Miller-Rabin rounds.. but it doesn't check for parity if the tested number is bigger than a word.
This leads to odd performances:
func BenchmarkPP2(b *testing.B) {
// 521419622856657689423872613771 * 2
n := new(big.Int)
n.SetString("1042839245713315378847745227542", 10)
for i := 0; i < b.N; i++ {
dummy = n.ProbablyPrime(30)
}
}
func BenchmarkPP3(b *testing.B) {
// 521419622856657689423872613771 * 3
n := new(big.Int)
n.SetString("1564258868569973068271617841313", 10)
for i := 0; i < b.N; i++ {
dummy = n.ProbablyPrime(30)
}
}
The ProbablyPrime function in math/big filters out multiples of small odd primes before performing the Miller-Rabin rounds.. but it doesn't check for parity if the tested number is bigger than a word.
This leads to odd performances:
Gives
The text was updated successfully, but these errors were encountered: