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

Method Powmod

WindowsShellcodeInjector/RSA.cpp:64–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64BigUint math::Powmod(BigUint n, BigUint e, BigUint m) {
65 if (e == 1) return n % m;
66 if (e == 0) return 1;
67
68 if ((e & 1) == 1) {
69 // y = n ^ e mod m
70 // y = ((n mod m) * ((n ^ (e-1) mod m))) mod m
71 return ((n % m) * (Powmod(n, e - 1, m))) % m;
72 }
73 BigUint tmp = Powmod(n, e / 2, m);
74 return (tmp * tmp) % m;
75}
76
77BigUint math::Invert(BigUint a, BigUint n) {
78 BigUint result;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected