mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibCrypto+LibJS: Move Power to method of {Unsigned,Signed}BigInteger
Having it as a method instead of a free function is necessary for the next commits and generally allows for optimizations that require deeper access into the `UnsignedBigInteger` / `SignedBigInteger`. Also restrict the exponent to 32 bits to avoid huge memory allocations.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
a952d000be
commit
5a4cfd05d0
Notes:
github-actions[bot]
2025-05-23 09:58:36 +00:00
Author: https://github.com/devgianlu Commit: https://github.com/LadybirdBrowser/ladybird/commit/5a4cfd05d0a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4507 Reviewed-by: https://github.com/gmta ✅
@@ -106,6 +106,7 @@ public:
|
||||
[[nodiscard]] SignedBigInteger shift_right(size_t num_bits) const;
|
||||
[[nodiscard]] SignedBigInteger multiplied_by(SignedBigInteger const& other) const;
|
||||
[[nodiscard]] SignedDivisionResult divided_by(SignedBigInteger const& divisor) const;
|
||||
[[nodiscard]] SignedBigInteger pow(u32 exponent) const;
|
||||
|
||||
[[nodiscard]] ErrorOr<SignedBigInteger> mod_power_of_two(size_t power_of_two) const;
|
||||
[[nodiscard]] ErrorOr<SignedBigInteger> try_shift_left(size_t num_bits) const;
|
||||
|
||||
Reference in New Issue
Block a user