This commit is contained in:
Nicholas Ward 2023-04-19 14:56:08 -07:00
parent cb23bfcade
commit 6d84b988ba
2 changed files with 6 additions and 2 deletions

View File

@ -55,7 +55,8 @@ e_zero_return:
// stack: e==0, b==0, len, b_loc, e_loc, m_loc, out_loc, s1, s2, s3, s4, s5, retdest
MUL // logical and
%jumpi(b_and_e_zero)
// End of special cases.
// We store the repeated-squares accumulator x_i in scratch_1, starting with x_0 := b.
DUP1

View File

@ -299,7 +299,10 @@ fn test_modexp_bignum(b: BigUint, e: BigUint, m: BigUint, expected_output: BigUi
scratch_5.into(),
],
)?;
new_memory.resize(new_memory.len().max(output_start_loc + output_len), 0.into());
new_memory.resize(
new_memory.len().max(output_start_loc + output_len),
0.into(),
);
let output = mem_vec_to_biguint(&new_memory[output_start_loc..output_start_loc + output_len]);
assert_eq!(output, expected_output);