1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:57:47 +00:00

LibCrypto+LibJS: Better bigint bitwise_or binop

Similar to the bitwise_and change, but we have to be careful to
sign-extend two's complement numbers only up to the highest set bit
in the positive number.
This commit is contained in:
Nico Weber 2022-01-18 08:46:42 -05:00 committed by Ali Mohammad Pur
parent 1f98639396
commit 013799a4dd
8 changed files with 77 additions and 23 deletions

View file

@ -82,12 +82,14 @@ public:
void clamp_to_trimmed_length();
void resize_with_leading_zeros(size_t num_words);
size_t one_based_index_of_highest_set_bit() const;
UnsignedBigInteger plus(const UnsignedBigInteger& other) const;
UnsignedBigInteger minus(const UnsignedBigInteger& other) const;
UnsignedBigInteger bitwise_or(const UnsignedBigInteger& other) const;
UnsignedBigInteger bitwise_and(const UnsignedBigInteger& other) const;
UnsignedBigInteger bitwise_xor(const UnsignedBigInteger& other) const;
UnsignedBigInteger bitwise_not_fill_to_size(size_t) const;
UnsignedBigInteger bitwise_not_fill_to_one_based_index(size_t) const;
UnsignedBigInteger shift_left(size_t num_bits) const;
UnsignedBigInteger multiplied_by(const UnsignedBigInteger& other) const;
UnsignedDivisionResult divided_by(const UnsignedBigInteger& divisor) const;