The problem of rsa key-generation getting stuck in a loop for (pointlessly)