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

Function operator-

src/cryptlib/integer.cpp:1755–1776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1753}
1754
1755Integer operator-(const Integer &a, const Integer& b)
1756{
1757 Integer diff((word)0, STDMAX(a.reg.size, b.reg.size));
1758 if (a.NotNegative())
1759 {
1760 if (b.NotNegative())
1761 PositiveSubtract(diff, a, b);
1762 else
1763 PositiveAdd(diff, a, b);
1764 }
1765 else
1766 {
1767 if (b.NotNegative())
1768 {
1769 PositiveAdd(diff, a, b);
1770 diff.sign = Integer::NEGATIVE;
1771 }
1772 else
1773 PositiveSubtract(diff, b, a);
1774 }
1775 return diff;
1776}
1777
1778Integer& Integer::operator-=(const Integer& t)
1779{

Callers

nothing calls this directly

Calls 3

PositiveSubtractFunction · 0.85
PositiveAddFunction · 0.85
NotNegativeMethod · 0.80

Tested by

no test coverage detected