#include <iostream>
#include "euclidean.h"
#include "mod_pow.h"
typedef ttmath::UInt<64> BigUInt;
int main(int argc, char** argv) {
BigUInt p = "33478071698956898786044169848212690817704794983713768568912431388982883793878002287614711652531743087737814467999489";
BigUInt q = "36746043666799590428244633799627952632279158164343087642676032283815739666511279233373417143396810270092798736308917";
BigUInt n = p * q;
BigUInt fi = (p - 1) * (q - 1);
BigUInt e = 3;
while( e < fi) {
if (ttmath::gcd(e, fi) == 1)
break;
e+=2;
}
BigUInt d = ttmath::mod_inverse(e, fi);
BigUInt message = 1234567890;
BigUInt encrypt = ttmath::fastModPow(message, e, n);
std::cout << encrypt << std::endl;
BigUInt decrypt = ttmath::fastModPow(encrypt, d, n);
std::cout << decrypt << std::endl;
system("pause");
return 0;
}