-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Poseidon2 verify_batch start_top_level
is not constrained only at start
#1403
Conversation
…appen only once during top level
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I should note that when the row is not top level at all we are not constraining start_top_level. We don't need to because the value of start_top_level is not relevant for those rows (setting it to 1 on those rows neither allows an exploit nor causes a constraint to fail), but this maybe should be documented (or we could just constrain it to be 0 on those rows).
I'll constrain it's zero just for clarity. |
Can't we just do
instead of
|
I think so, will add it. |
Commit: 2c23fa1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing
Finding Link: https://cantina.xyz/code/c486d600-bed0-4fc6-aed1-de759fd29fa2/findings/167
Description of Fix
While the variable was called
start_top_level
, we only constrained that the top level hasstart_top_level = 1
but never that it must be equal to0
on non-top levels. We change the existing constraint so that it enforcesstart_top_level = 1
iff its the start of a top level (meaning previous row isend
and current row isincorporate_row
).Closes INT-3567