chore: ecc group audit 1- remove dead code, documentation and test#20886
Merged
kashbrti merged 17 commits intomerge-train/barretenbergfrom Mar 3, 2026
Merged
chore: ecc group audit 1- remove dead code, documentation and test#20886kashbrti merged 17 commits intomerge-train/barretenbergfrom
kashbrti merged 17 commits intomerge-train/barretenbergfrom
Conversation
added md explaining the flow + a bit of renaming
Primary changes: - Replace methods of the form `get_*_gate_connected_component` with `GatePattern` structs that specify the conditions under which each wire is constrained for each gate type - Test correctness of `GatePattern`'s by perturbing relation inputs to empirically check which wires are constrained (`gate_patterns.test.cpp`) - Resolves a few bugs/errors identified by the aforementioned tests (see PR comments) - Use `update_used_witnesses` in `fix_witness` to avoid need for ad-hoc handling in the tooling Cleanup: - Replace use of `block_idx` with reference to `block` in several places for improved clarity --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ztec-packages into merge-train/barretenberg
…ztec-packages into merge-train/barretenberg
…ztec-packages into merge-train/barretenberg
kashbrti
commented
Mar 2, 2026
|
|
||
| #ifndef DISABLE_ASM | ||
|
|
||
| #include "barretenberg/ecc/groups/group.hpp" |
Contributor
Author
There was a problem hiding this comment.
this was only used in self_mixed_add_or_sub which was never used. our scalar multiplication function already does the conditional negation
Contributor
There was a problem hiding this comment.
Delete the file altogether?
kashbrti
commented
Mar 2, 2026
| // } | ||
|
|
||
| template <typename Fq, typename Fr, typename Params> | ||
| inline void group<Fq, Fr, Params>::conditional_negate_affine(const affine_element* src, |
suyash67
reviewed
Mar 3, 2026
| uint256_t compressed = P.compress(); | ||
| uint256_t compressed = uint256_t(P.x); | ||
| if (uint256_t(P.y).get_bit(0)) { | ||
| compressed.data[3] |= 0x8000000000000000ULL; |
Contributor
There was a problem hiding this comment.
Maybe declare 0x8000000000000000ULL as a static constant somewhere, especially if its being used in multiple places.
suyash67
reviewed
Mar 3, 2026
| } | ||
|
|
||
| /** | ||
| * Current flow... |
Contributor
There was a problem hiding this comment.
So glad we're getting rid of unused stuff here!
suyash67
approved these changes
Mar 3, 2026
Contributor
suyash67
left a comment
There was a problem hiding this comment.
Good stuff, thanks for doing this!
johnathan79717
pushed a commit
that referenced
this pull request
Mar 4, 2026
…20886) there's lots of code that is never used in ecc/group module, especially in WNAF implementation. This PR removes most of the unused code. We also: - add documentation for WNAF - add edge case testing for WNAF --------- Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: AztecBot <tech@aztecprotocol.com>
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.
there's lots of code that is never used in ecc/group module, especially in WNAF implementation.
This PR removes most of the unused code.
We also: