mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibCrypto: Implement arbitrarily sized right shifts
Previously we could only shift by words at a time
This commit is contained in:
parent
9045840e33
commit
1af9fa1968
Notes:
sideshowbarker
2024-07-17 06:40:35 +09:00
Author: https://github.com/Hendiadyoin1
Commit: 1af9fa1968
Pull-request: https://github.com/SerenityOS/serenity/pull/23619
Issue: https://github.com/SerenityOS/serenity/issues/23575
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/DanShaders ✅
6 changed files with 34 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue