From 75d1ffea005a1677faa89d6e50e7b9de7817a4f8 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 11 Jul 2021 23:48:40 +0300 Subject: [PATCH] LibCrypto: Add the >= operator to UnsignedBigInteger --- Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp | 5 +++++ Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp index 135bcf5270..1f036af432 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp @@ -337,6 +337,11 @@ bool UnsignedBigInteger::operator>(const UnsignedBigInteger& other) const return *this != other && !(*this < other); } +bool UnsignedBigInteger::operator>=(UnsignedBigInteger const& other) const +{ + return *this > other || *this == other; +} + } void AK::Formatter::format(FormatBuilder& fmtbuilder, const Crypto::UnsignedBigInteger& value) diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index e37c9e95b4..9b9e191247 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -99,6 +99,7 @@ public: bool operator!=(const UnsignedBigInteger& other) const; bool operator<(const UnsignedBigInteger& other) const; bool operator>(const UnsignedBigInteger& other) const; + bool operator>=(UnsignedBigInteger const& other) const; private: friend class UnsignedBigIntegerAlgorithms;