@@ -67,7 +67,7 @@ struct BigInt{
baseTen = baseTen.mult(BigInt(10));
++it;
}
-
+ trim();
template<typename InputIterator>
inline BigInt(InputIterator begin, InputIterator end) : data(begin, end), signum(1){}
@@ -27,7 +27,7 @@ private:
#endif
std::vector<char> buffer;
public:
- const static std::size_t buffersize = 256;
+ const static std::size_t buffersize = 1024;
#ifdef _WIN32
cppsocket(WSADATA d, SOCKET _s);
#else
@@ -29,8 +29,8 @@ std::ostream& operator<< <char>(std::ostream& out, std::vector<char> o){
int main(){
xoshiro_256 gen(42);
BigInt a(364598273448762ULL);
- BigInt b(gen, 8);
- BigInt mod("9301165293246235069759966068146313776551258669855356477271940698500929939755418247622530571466332330697816620308003246225290293476785304004840090056840661553451916748315356563734257724978000166406621823207925733850455027807451108123161768212073821382033500073069184011344280494573919716117539258909003");
+ BigInt b(gen, 31);
+ BigInt mod("25517712857249265246309662191040714920292930135958602873503082695880945015180270627160886016284304866241119009429935511497986916016509065559298646199688497746399172174316028774533924795864096565081478741603241830675436336762053778667047857025632695617746551090247164369324008907433218665135569658200641651876344533506145721941113011977317356006176781796659698883765657005845351846184505291996942442336931455986790727248315517902731173678888064950798931396279140373592203530274617983159864665935475637811846793653407441533829095478201308785445059955697867933027578011378694502392722655274554801068451419037021634697683");
std::cout << "(" << a.toString() << " ^ " << std::flush;
a = a.modPow(b, mod);
std::cout << "" << b.toString() << ")";