mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibCrypto: Add a += operation to UnsignedBigIntegerAlgorithms
This new operation is immediately used in several existing algorithms.
This commit is contained in:
parent
f4e6f58cc6
commit
5071989545
10 changed files with 151 additions and 47 deletions
|
@ -23,7 +23,6 @@ FLATTEN void UnsignedBigIntegerAlgorithms::multiply_without_allocation(
|
|||
UnsignedBigInteger& temp_shift_result,
|
||||
UnsignedBigInteger& temp_shift_plus,
|
||||
UnsignedBigInteger& temp_shift,
|
||||
UnsignedBigInteger& temp_plus,
|
||||
UnsignedBigInteger& output)
|
||||
{
|
||||
output.set_to_0();
|
||||
|
@ -39,8 +38,7 @@ FLATTEN void UnsignedBigIntegerAlgorithms::multiply_without_allocation(
|
|||
|
||||
// output += (right << shift_amount);
|
||||
shift_left_without_allocation(right, shift_amount, temp_shift_result, temp_shift_plus, temp_shift);
|
||||
add_without_allocation(output, temp_shift, temp_plus);
|
||||
output.set_to(temp_plus);
|
||||
add_into_accumulator_without_allocation(output, temp_shift);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue