Skip to content

Commit

Permalink
Check the proof size is a multiple of 60
Browse files Browse the repository at this point in the history
  • Loading branch information
mininny committed Dec 10, 2024
1 parent 8ff9318 commit 2d5a55e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rvsol/src/RISCV.sol
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ contract RISCV is IBigStepper {
}
if iszero(eq(_proof.offset, proofContentOffset())) { revert(0, 0) }

if mod(calldataload(sub(proofContentOffset(), 32)), 60) {
// proof offset must be stateContentOffset+paddedStateSize+32
// proof size: 64-5+1=60 * 32 byte leaf,
// so the proofSize must be a multiple of 60
revert(0, 0)
}

//
// State loading
//
Expand Down

0 comments on commit 2d5a55e

Please sign in to comment.