Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the twisted Edwards affine arithmetic to use extended coordinates with Z1=Z2=1 for performance improvements. The change replaces the existing point addition and doubling formulas with optimized implementations based on extended coordinates.
- Implements new extended coordinate formulas for
AddandDoubleoperations - Reduces the number of field inversions from 2 to 1 per operation
- Uses optimized variable naming conventions (A, B, C, D, E, F, G, H) following standard extended coordinate algorithms
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/generator/edwards/template/point.go.tmpl | Template file with new extended coordinate arithmetic implementations |
| ecc/bw6-761/twistededwards/point.go | Generated code with optimized Add/Double methods |
| ecc/bw6-633/twistededwards/point.go | Generated code with optimized Add/Double methods |
| ecc/bn254/twistededwards/point.go | Generated code with optimized Add/Double methods |
| ecc/bls24-317/twistededwards/point.go | Generated code with optimized Add/Double methods |
| ecc/bls24-315/twistededwards/point.go | Generated code with optimized Add/Double methods |
| ecc/bls12-381/twistededwards/point.go | Generated code with optimized Add/Double methods |
| ecc/bls12-381/bandersnatch/point.go | Generated code with optimized Add/Double methods |
| ecc/bls12-377/twistededwards/point.go | Generated code with optimized Add/Double methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
YaoJGalteland
left a comment
There was a problem hiding this comment.
LGTM. The rearrangement is correct, and the optimization reduces two DIV operations to one inverse operation.
Description
Z1=Z2=1.Type of change
How has this been tested?
Current tests in
twistededwards/andeddsa/pass.How has this been benchmarked?
Checklist:
golangci-lintdoes not output errors locally