Finalize the miller-rabin-test