From 582bc41a0bb7fb02a1a68717fdf83c6fe432d422 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim <56402156+fkrause98@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:23:18 -0300 Subject: [PATCH] Update precompiles/Modexp.yul Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com> --- precompiles/Modexp.yul | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/precompiles/Modexp.yul b/precompiles/Modexp.yul index ab263fa7..ab6b8b47 100644 --- a/precompiles/Modexp.yul +++ b/precompiles/Modexp.yul @@ -369,15 +369,14 @@ object "ModExp" { let ithLimbBorrowResult let ithLimbSubtractionResult let borrow := 0 - let limbOffset := 0 + let limbOffset := shl(5, numberOfLimbs) for {let i := numberOfLimbs} gt(i, 0) {i := sub(i, 1)} { - limbOffset := mul(sub(i,1), 32) leftIthLimbValue := getLimbValueAtOffset(lhsPointer, limbOffset) rightIthLimbValue := getLimbValueAtOffset(rhsPointer, limbOffset) ithLimbSubtractionResult, borrow := subLimbsWithBorrow(leftIthLimbValue, rightIthLimbValue, borrow) storeLimbValueAtOffset(resultPointer, limbOffset, ithLimbSubtractionResult) - + limbOffset := sub(limbOffset, LIMB_SIZE_IN_BYTES()) } }