chore: avoid nonnative dereferences #861
Merged
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
With the upcoming pr #749 it is necessary that we do not change the limb values of
emulated.Element
values. Mostly the API is designed in a way that this doesn't happen (we pass in and out pointers and do not perform in-place modifications), but there are a few cases in nonnative algebra where the API is overridden. This is mostly due to that for structs containing nonnative elements we need to use the value instead of pointer to count the number of field elements to allocate and have initialized values.For example, if we have definition like:
and we compute
then we modify the value
P.X
. Now, as the multiplication checks are deferred for amortizing some computations, we get a failed check.This PR changes such occurrences, making #749 more streamlined. Similar changes are already incorporated in #846.
Type of change
How has this been tested?
How has this been benchmarked?
Not benchmarked, circuit stats are the same are the same.
Checklist:
golangci-lint
does not output errors locally