Working Miller-Rabin