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

Function Subtract

src/cryptlib/integer.cpp:156–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156static word Subtract(word *C, const word *A, const word *B, unsigned int N)
157{
158 assert (N%2 == 0);
159
160 word borrow=0;
161 for (unsigned i = 0; i < N; i+=2)
162 {
163 dword_union u;
164 u.dw = (dword) A[i] - B[i] - borrow;
165 C[i] = u.low;
166 u.dw = (dword) A[i+1] - B[i+1] - (word)(0-u.high);
167 C[i+1] = u.low;
168 borrow = 0-u.high;
169 }
170 return borrow;
171}
172
173#endif // defined(_MSC_VER) && defined(_M_IX86) && (_M_IX86<=500)
174

Callers 14

RecursiveMultiplyFunction · 0.85
RecursiveMultiplyTopFunction · 0.85
MontgomeryReduceFunction · 0.85
HalfMontgomeryReduceFunction · 0.85
CorrectQuotientEstimateFunction · 0.85
DivideFunction · 0.85
AlmostInverseFunction · 0.85
MultiplyByPower2ModFunction · 0.85
PositiveSubtractFunction · 0.85
AddMethod · 0.85
integer.cppFile · 0.85
SubtractMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected