LibCrypto: Introduce a falible API for SignedBigInteger::shift_left

This commit is contained in:
Jess
2025-02-19 02:20:30 +13:00
committed by Tim Flynn
parent c48641c13a
commit 8fda05d8b7
Notes: github-actions[bot] 2025-02-19 14:02:02 +00:00
6 changed files with 48 additions and 8 deletions

View File

@@ -276,9 +276,14 @@ bool SignedBigInteger::operator>(UnsignedBigInteger const& other) const
return *this != other && !(*this < other);
}
FLATTEN ErrorOr<SignedBigInteger> SignedBigInteger::try_shift_left(size_t num_bits) const
{
return SignedBigInteger { TRY(m_unsigned_data.try_shift_left(num_bits)), m_sign };
}
FLATTEN SignedBigInteger SignedBigInteger::shift_left(size_t num_bits) const
{
return SignedBigInteger { m_unsigned_data.shift_left(num_bits), m_sign };
return MUST(try_shift_left(num_bits));
}
FLATTEN SignedBigInteger SignedBigInteger::shift_right(size_t num_bits) const