Rabin-Miller primality test and Pollard's rho method