RSA algorithm implemented in C++