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

Function operator+

src/cryptlib/integer.cpp:1709–1730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1707}
1708
1709Integer operator+(const Integer &a, const Integer& b)
1710{
1711 Integer sum((word)0, STDMAX(a.reg.size, b.reg.size));
1712 if (a.NotNegative())
1713 {
1714 if (b.NotNegative())
1715 PositiveAdd(sum, a, b);
1716 else
1717 PositiveSubtract(sum, a, b);
1718 }
1719 else
1720 {
1721 if (b.NotNegative())
1722 PositiveSubtract(sum, b, a);
1723 else
1724 {
1725 PositiveAdd(sum, a, b);
1726 sum.sign = Integer::NEGATIVE;
1727 }
1728 }
1729 return sum;
1730}
1731
1732Integer& Integer::operator+=(const Integer& t)
1733{

Callers

nothing calls this directly

Calls 3

PositiveAddFunction · 0.85
PositiveSubtractFunction · 0.85
NotNegativeMethod · 0.80

Tested by

no test coverage detected