MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / a_exp_b_mod_c

Function a_exp_b_mod_c

src/cryptlib/integer.cpp:2097–2109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2095}
2096
2097Integer a_exp_b_mod_c(const Integer &x, const Integer& e, const Integer& m)
2098{
2099 if (m.IsEven())
2100 {
2101 ModularArithmetic mr(m);
2102 return mr.ConvertOut(mr.Exponentiate(mr.ConvertIn(x), e));
2103 }
2104 else
2105 {
2106 MontgomeryRepresentation mr(m);
2107 return mr.ConvertOut(mr.Exponentiate(mr.ConvertIn(x), e));
2108 }
2109}
2110
2111Integer Integer::Gcd(const Integer &a, const Integer &b)
2112{

Callers 7

IsFermatProbablePrimeFunction · 0.85
IsStrongProbablePrimeFunction · 0.85
ProvablePrimeFunction · 0.85
ModularSquareRootFunction · 0.85
PrimeAndGeneratorMethod · 0.85
RawDecryptMethod · 0.85
ModularExponentiationFunction · 0.85

Calls 4

IsEvenMethod · 0.80
ConvertOutMethod · 0.45
ExponentiateMethod · 0.45
ConvertInMethod · 0.45

Tested by

no test coverage detected