MCPcopy Create free account
hub / github.com/Yeuoly/0xUBypass / repeatMod

Function repeatMod

WindowsShellcodeInjector/RSA.cpp:87–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87BigUint repeatMod(BigUint x, BigUint a) {
88 BigUint b = x - 1;
89 BigUint ans = 1;
90 int times = 0;
91 while (b > 0) {
92 times++;
93 if ((b & 1) == 1) {
94 ans = ((ans % x) * (a % x)) % x;
95 }
96 a = a * a % x;
97 b >>= 1;
98 }
99 return ans;
100}
101
102bool math::IsPrime(BigUint n, int k) {
103 //Miller-Rabin

Callers 1

IsPrimeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected