mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:28:14 +00:00
LibCrypto: memcmp() all bytes in UnsignedBigInteger::operator==
`length` is only the (trimmed) size of the word vector, so we have to multiply it with the size of each element to ensure all bytes are compared. Fixes #5335.
This commit is contained in:
parent
781d29a337
commit
1c6fd749dc
1 changed files with 1 additions and 1 deletions
|
@ -281,7 +281,7 @@ bool UnsignedBigInteger::operator==(const UnsignedBigInteger& other) const
|
|||
if (length != other.trimmed_length())
|
||||
return false;
|
||||
|
||||
return !__builtin_memcmp(m_words.data(), other.words().data(), length);
|
||||
return !__builtin_memcmp(m_words.data(), other.words().data(), length * (BITS_IN_WORD / 8));
|
||||
}
|
||||
|
||||
bool UnsignedBigInteger::operator!=(const UnsignedBigInteger& other) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue