update & add Miller-Rabin primality test