Skip to content

Commit

Permalink
Update precompiles/Modexp.yul
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Litteri <[email protected]>
  • Loading branch information
fkrause98 and ilitteri authored Sep 29, 2023
1 parent f85e7e1 commit 582bc41
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions precompiles/Modexp.yul
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand Down

0 comments on commit 582bc41

Please sign in to comment.