Miller-Rabin primality testing.