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

Function phi

WindowsShellcodeInjector/RSA.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26int phi(int n)
27{
28 float result = n;
29 for (int p = 2; p * p <= n; ++p)
30 {
31 if (n % p == 0)
32 {
33 while (n % p == 0)
34 n /= p;
35 result *= (1.0 - (1.0 / (float)p));
36 }
37 }
38
39 if (n > 1)
40 result *= (1.0 - (1.0 / (float)n));
41
42 return (int)result;
43}
44
45BigUint math::Phi(BigUint e) {
46 BigUint result = e;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected