LibCrypto: Use a right shift for division in NumberTheory::Power

This commit is contained in:
Hendiadyoin1 2024-03-18 00:40:51 +01:00 committed by Andrew Kaster
parent 4339868296
commit c96d44e9cf
Notes: sideshowbarker 2024-07-16 20:51:53 +09:00

View File

@ -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));