mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibCrypto: Fix -0 and 0 non-equality
SignedBigInteger::operator==(const UnsignedBigInteger&) was rejecting all negative value before testing for equality. It now accepts negative zero and test for a value equality with the UnsignedBigInteger.
This commit is contained in:
parent
6a937312b3
commit
4ab8ad2ed2
Notes:
sideshowbarker
2024-07-17 07:09:11 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/4ab8ad2ed2 Pull-request: https://github.com/SerenityOS/serenity/pull/14529 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/kleinesfilmroellchen
|
@ -246,7 +246,7 @@ FLATTEN SignedBigInteger SignedBigInteger::bitwise_xor(SignedBigInteger const& o
|
|||
|
||||
bool SignedBigInteger::operator==(UnsignedBigInteger const& other) const
|
||||
{
|
||||
if (m_sign)
|
||||
if (m_sign && m_unsigned_data != 0)
|
||||
return false;
|
||||
return m_unsigned_data == other;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue