fix(kernels): add array overflow composer error#762
Merged
Conversation
3d6a86b to
29ba730
Compare
fix: linting
a24dda1 to
5364b22
Compare
6 tasks
LHerskind
approved these changes
Jun 6, 2023
| #include "aztec3/circuits/abis/public_kernel/public_kernel_inputs.hpp" | ||
| #include "aztec3/circuits/abis/public_kernel/public_kernel_inputs_no_previous_kernel.hpp" | ||
| #include "aztec3/circuits/hash.hpp" | ||
| #include "aztec3/constants.hpp" |
Contributor
There was a problem hiding this comment.
What do you need the constants for here?
… md/array-push-assertions
This was referenced Jul 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Swaps out
push_array_to_arrayASSERT statements with composer errors, right now appending arrays of equal sizes will silently fail and overflow, overwriting memory in places that it shouldn't. e.g. adding two commitment arrays of max size will cause them to overflow into the nullifiers.This change creates a composer kernel error for this case.
aztec-packages/circuits/cpp/src/aztec3/utils/array.hpp
Line 146 in e54e404
Please provide a paragraph or two giving a summary of the change, including relevant motivation and context.
Checklist: