Change Mirror-Rabin to the primality algorithm