| 2225 | } |
| 2226 | |
| 2227 | Integer ModularArithmetic::CascadeExponentiate(const Integer &x, const Integer &e1, const Integer &y, const Integer &e2) const |
| 2228 | { |
| 2229 | if (modulus.IsOdd()) |
| 2230 | { |
| 2231 | MontgomeryRepresentation dr(modulus); |
| 2232 | return dr.ConvertOut(dr.CascadeExponentiate(dr.ConvertIn(x), e1, dr.ConvertIn(y), e2)); |
| 2233 | } |
| 2234 | else |
| 2235 | return AbstractRing<Integer>::CascadeExponentiate(x, e1, y, e2); |
| 2236 | } |
| 2237 | |
| 2238 | MontgomeryRepresentation::MontgomeryRepresentation(const Integer &m) // modulus must be odd |
| 2239 | : ModularArithmetic(m), |
nothing calls this directly
no test coverage detected