mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-19 09:17:38 +03:00
LibCrypto: Use a right shift for division in NumberTheory::Power
This commit is contained in:
parent
4339868296
commit
c96d44e9cf
Notes:
sideshowbarker
2024-07-16 20:51:53 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/c96d44e9cf 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 ✅
@ -30,7 +30,7 @@ static IntegerType Power(IntegerType const& b, IntegerType const& e)
|
||||
exp.set_to(exp.multiplied_by(base));
|
||||
|
||||
// ep = ep / 2;
|
||||
ep.set_to(ep.divided_by(IntegerType { 2 }).quotient);
|
||||
ep.set_to(ep.shift_right(1));
|
||||
|
||||
// base = base * base
|
||||
base.set_to(base.multiplied_by(base));
|
||||
|
Loading…
Reference in New Issue
Block a user