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

Method Square

src/cryptlib/integer.cpp:2260–2271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2258}
2259
2260Integer MontgomeryRepresentation::Square(const Integer &a) const
2261{
2262 word *const T = workspace.ptr;
2263 word *const R = result.reg.ptr;
2264 const unsigned int N = modulus.reg.size;
2265 assert(a.reg.size<=N);
2266
2267 RecursiveSquare(T, T+2*N, a.reg, a.reg.size);
2268 SetWords(T+2*a.reg.size, 0, 2*N-2*a.reg.size);
2269 MontgomeryReduce(R, T+2*N, T, modulus.reg, u.reg, N);
2270 return result;
2271}
2272
2273Integer MontgomeryRepresentation::ConvertOut(const Integer &a) const
2274{

Callers

nothing calls this directly

Calls 4

RecursiveSquareFunction · 0.85
SetWordsFunction · 0.85
MontgomeryReduceFunction · 0.85
HalfMontgomeryReduceFunction · 0.85

Tested by

no test coverage detected