From 38e9e35380c1598df572a056cc60e9d719efa61c Mon Sep 17 00:00:00 2001 From: Gal Horowitz Date: Wed, 30 Jun 2021 20:36:08 +0300 Subject: [PATCH] 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. --- Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp index f665f401c7..77c89f4315 100644 --- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp +++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp @@ -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; }