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

Method Inverse

src/cryptlib/integer.cpp:2199–2209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2197}
2198
2199Integer ModularArithmetic::Inverse(const Integer &a) const
2200{
2201 if (!a)
2202 return a;
2203
2204 CopyWords(result.reg.ptr, modulus.reg, modulus.reg.size);
2205 if (::Subtract(result.reg.ptr, result.reg, a.reg, a.reg.size))
2206 Decrement(result.reg.ptr+a.reg.size, 1, modulus.reg.size-a.reg.size);
2207
2208 return result;
2209}
2210
2211Integer ModularArithmetic::MultiplicativeInverse(const Integer &a) const
2212{

Callers

nothing calls this directly

Calls 3

CopyWordsFunction · 0.85
SubtractFunction · 0.85
DecrementFunction · 0.85

Tested by

no test coverage detected