mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibCrypto: Add LCM functionality to UnsignedBigInteger
This commit is contained in:
parent
adaa8e418a
commit
d55f759bbb
|
|
@ -323,6 +323,13 @@ FLATTEN UnsignedBigInteger UnsignedBigInteger::gcd(UnsignedBigInteger const& oth
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FLATTEN UnsignedBigInteger UnsignedBigInteger::lcm(UnsignedBigInteger const& other) const
|
||||||
|
{
|
||||||
|
UnsignedBigInteger result;
|
||||||
|
MP_MUST(mp_lcm(&m_mp, &other.m_mp, &result.m_mp));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
u32 UnsignedBigInteger::hash() const
|
u32 UnsignedBigInteger::hash() const
|
||||||
{
|
{
|
||||||
if (m_hash.has_value())
|
if (m_hash.has_value())
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ public:
|
||||||
[[nodiscard]] UnsignedDivisionResult divided_by(UnsignedBigInteger const& divisor) const;
|
[[nodiscard]] UnsignedDivisionResult divided_by(UnsignedBigInteger const& divisor) const;
|
||||||
[[nodiscard]] UnsignedBigInteger pow(u32 exponent) const;
|
[[nodiscard]] UnsignedBigInteger pow(u32 exponent) const;
|
||||||
[[nodiscard]] UnsignedBigInteger gcd(UnsignedBigInteger const& other) const;
|
[[nodiscard]] UnsignedBigInteger gcd(UnsignedBigInteger const& other) const;
|
||||||
|
[[nodiscard]] UnsignedBigInteger lcm(UnsignedBigInteger const& other) const;
|
||||||
|
|
||||||
[[nodiscard]] u32 hash() const;
|
[[nodiscard]] u32 hash() const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user