LibCrypto: Replace use of negate() in SignedBigInteger::bitwise_or

Calling negate() on a big integer does not make it negative, but
rather flips its sign, so this was not actually acting as an OR.
This commit is contained in:
Gal Horowitz 2021-06-30 20:36:08 +03:00 committed by Andreas Kling
commit 38e9e35380
Notes: sideshowbarker 2024-07-18 11:10:51 +09:00

View file

@ -156,8 +156,7 @@ FLATTEN SignedBigInteger SignedBigInteger::bitwise_or(const SignedBigInteger& ot
auto result = bitwise_or(other.unsigned_value());
// The sign bit will have to be OR'd manually.
if (other.is_negative())
result.negate();
result.m_sign = is_negative() || other.is_negative();
return result;
}