Skip to content

Conversation

ivokub
Copy link
Collaborator

@ivokub ivokub commented Sep 30, 2025

Description

Unify method receivers and remove unused functions

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Note

Convert Pairing-related methods to pointer receivers across emulated/native pairings and remove unused G1 curve precompute code in native BLS curves.

  • Emulated pairings (sw_bls12381, sw_bn254, sw_bw6761):
    • Switch many Pairing methods to pointer receivers: Pair, PairingCheck, MillerLoop, millerLoopLines, FinalExponentiation, AssertFinalExponentiationIsOne, MillerLoopAndMul, AssertMillerLoopAndFinalExpIsOne, IsMillerLoopAndFinalExpOne, equality/assert helpers, mux helpers, on-curve/subgroup checks, and internal step helpers.
  • Native pairings:
    • sw_bls12377/pairing2.go, sw_bls24315/pairing2.go: change MuxG2 and MuxGt to pointer receivers.
    • sw_bls12377 and sw_bls24315 inner modules: remove unused G1 curve precompute code (computedCurveTable, computeCurveTable, curvePoints/getCurvePoints); keep twist tables.

Written by Cursor Bugbot for commit c662389. This will update automatically on new commits. Configure here.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes method receivers across pairing types by converting value receivers to pointer receivers and removes unused curve-related functions and variables. The changes improve consistency in the API while cleaning up dead code.

  • Unified all pairing method receivers to use pointer receivers (*Pairing) instead of value receivers (Pairing)
  • Removed unused computeCurveTable() functions and related curvePoints structs from BLS curve implementations
  • Cleaned up global variables and initialization code that was no longer needed

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
std/algebra/native/sw_bls24315/pairing2.go Changed MuxG2 and MuxGt methods to use pointer receivers
std/algebra/native/sw_bls24315/inner_compute.go Removed unused computeCurveTable function
std/algebra/native/sw_bls24315/inner.go Removed unused curvePoints struct and related code
std/algebra/native/sw_bls12377/pairing2.go Changed MuxG2 and MuxGt methods to use pointer receivers
std/algebra/native/sw_bls12377/inner_compute.go Removed unused computeCurveTable function
std/algebra/native/sw_bls12377/inner.go Removed unused curvePoints struct and related code
std/algebra/emulated/sw_bw6761/pairing.go Changed all pairing methods to use pointer receivers
std/algebra/emulated/sw_bn254/pairing.go Changed all pairing methods to use pointer receivers
std/algebra/emulated/sw_bls12381/pairing.go Changed all pairing methods to use pointer receivers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant