LibCrypto: Implement arbitrarily sized right shifts

Previously we could only shift by words at a time
This commit is contained in:
Hendiadyoin1 2024-03-18 00:40:03 +01:00 committed by Andrew Kaster
commit 1af9fa1968
Notes: sideshowbarker 2024-07-17 06:40:35 +09:00
6 changed files with 34 additions and 0 deletions

View file

@ -281,6 +281,11 @@ FLATTEN SignedBigInteger SignedBigInteger::shift_left(size_t num_bits) const
return SignedBigInteger { m_unsigned_data.shift_left(num_bits), m_sign };
}
FLATTEN SignedBigInteger SignedBigInteger::shift_right(size_t num_bits) const
{
return SignedBigInteger { m_unsigned_data.shift_right(num_bits), m_sign };
}
FLATTEN SignedBigInteger SignedBigInteger::multiplied_by(SignedBigInteger const& other) const
{
bool result_sign = m_sign ^ other.m_sign;