Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Fix incorrect calculation for required number of keccak256 hash rounds #63

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/precompiles/Keccak256.yul
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object "Keccak256" {
0 // per precompile interpreted value (0 since circuit doesn't react on this value anyway)
)
// 4. Calculate number of required hash rounds per calldata
let numRounds := div(add(ptrLength, sub(BLOCK_SIZE(), 1)), BLOCK_SIZE())
let numRounds := add(div(ptrLength, BLOCK_SIZE()), 1)
let gasToPay := mul(KECCAK_ROUND_GAS_COST(), numRounds)

// 5. Call precompile
Expand Down
Loading