LibCrypto: Add operator>() to UnsignedBigInteger and SignedBigInteger

Piggybacking on operator!=() and operator<().
This commit is contained in:
Linus Groh
2021-07-07 17:37:17 +01:00
parent fda22c6889
commit 89641d90db
Notes: sideshowbarker 2024-07-18 10:12:32 +09:00
4 changed files with 18 additions and 0 deletions

View File

@@ -202,6 +202,11 @@ bool SignedBigInteger::operator<(const UnsignedBigInteger& other) const
return m_unsigned_data < other;
}
bool SignedBigInteger::operator>(const UnsignedBigInteger& other) const
{
return *this != other && !(*this < other);
}
FLATTEN SignedBigInteger SignedBigInteger::shift_left(size_t num_bits) const
{
return SignedBigInteger { m_unsigned_data.shift_left(num_bits), m_sign };
@@ -261,4 +266,9 @@ bool SignedBigInteger::operator<(const SignedBigInteger& other) const
return m_unsigned_data < other.m_unsigned_data;
}
bool SignedBigInteger::operator>(const SignedBigInteger& other) const
{
return *this != other && !(*this < other);
}
}