Skip to content

Commit

Permalink
Merge pull request #6 from ethereum-optimism/amadi/fix-stack-too-deep
Browse files Browse the repository at this point in the history
fix stack too deep - forge coverage
  • Loading branch information
clabby authored Nov 7, 2024
2 parents 7d93217 + 297d174 commit 3b1e7bb
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions contracts/lib/LibKeccak.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,32 @@ library LibKeccak {
let xs1 := xor(stateElem(ptr, 1), D1)
let A1 := xor(shl(1, xs1), shr(63, xs1))

setStateElem(ptr, 0, xor(stateElem(ptr, 0), D0))
rhoPi(ptr, 1, 6, 44, D1)
rhoPi(ptr, 6, 9, 20, D4)
rhoPi(ptr, 9, 22, 61, D2)
rhoPi(ptr, 22, 14, 39, D4)
rhoPi(ptr, 14, 20, 18, D0)
rhoPi(ptr, 20, 2, 62, D2)
rhoPi(ptr, 2, 12, 43, D2)
rhoPi(ptr, 12, 13, 25, D3)
rhoPi(ptr, 13, 19, 8, D4)
rhoPi(ptr, 19, 23, 56, D3)
rhoPi(ptr, 23, 15, 41, D0)
rhoPi(ptr, 15, 4, 27, D4)
rhoPi(ptr, 4, 24, 14, D4)
rhoPi(ptr, 24, 21, 2, D1)
rhoPi(ptr, 21, 8, 55, D3)
rhoPi(ptr, 8, 16, 45, D1)
rhoPi(ptr, 16, 5, 36, D0)
rhoPi(ptr, 5, 3, 28, D3)
rhoPi(ptr, 3, 18, 21, D3)
rhoPi(ptr, 18, 17, 15, D2)
rhoPi(ptr, 17, 11, 10, D1)
rhoPi(ptr, 11, 7, 6, D2)
rhoPi(ptr, 7, 10, 3, D0)
setStateElem(ptr, 10, A1)
let _ptr := ptr
setStateElem(_ptr, 0, xor(stateElem(_ptr, 0), D0))
rhoPi(_ptr, 1, 6, 44, D1)
rhoPi(_ptr, 6, 9, 20, D4)
rhoPi(_ptr, 9, 22, 61, D2)
rhoPi(_ptr, 22, 14, 39, D4)
rhoPi(_ptr, 14, 20, 18, D0)
rhoPi(_ptr, 20, 2, 62, D2)
rhoPi(_ptr, 2, 12, 43, D2)
rhoPi(_ptr, 12, 13, 25, D3)
rhoPi(_ptr, 13, 19, 8, D4)
rhoPi(_ptr, 19, 23, 56, D3)
rhoPi(_ptr, 23, 15, 41, D0)
rhoPi(_ptr, 15, 4, 27, D4)
rhoPi(_ptr, 4, 24, 14, D4)
rhoPi(_ptr, 24, 21, 2, D1)
rhoPi(_ptr, 21, 8, 55, D3)
rhoPi(_ptr, 8, 16, 45, D1)
rhoPi(_ptr, 16, 5, 36, D0)
rhoPi(_ptr, 5, 3, 28, D3)
rhoPi(_ptr, 3, 18, 21, D3)
rhoPi(_ptr, 18, 17, 15, D2)
rhoPi(_ptr, 17, 11, 10, D1)
rhoPi(_ptr, 11, 7, 6, D2)
rhoPi(_ptr, 7, 10, 3, D0)
setStateElem(_ptr, 10, A1)
}

// Inner `chi` function, unrolled in `chi` for performance.
Expand Down

0 comments on commit 3b1e7bb

Please sign in to comment.