Miller-Rabin primality testing