Skip to content

Conversation

@carloskiki
Copy link

This fixes a few issues with MillerLoopResult.

  • It makes it more usable. Currently, the type cannot be converted into a Gt element with final_exponentiation, which makes the type quite useless otherwise.

  • It makes it coherent. The type documentation states that it can't be compared. However, the type still implements PartialEq and Eq which is contradictory. Moreover, the implementation of Eq and PartialEq was wrong. It is known that two MillerLoopResults are not numerically equivalent. This fixes the type by adding a final_verify method, and implementing Eq and ParitalEq based on it.

  • Allows for trivial construction. A MillerLoopResult can now be constructed using the top level miller_loop function.

Copilot AI review requested due to automatic review settings November 3, 2025 02:14
Copy link

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 refactors the pairing operations by extracting the Miller loop into a separate public function and adds new equality comparison capabilities to MillerLoopResult. It also removes the rust-toolchain file, allowing the MSRV specified in Cargo.toml to take precedence.

  • Refactored pairing() to use the new miller_loop() function
  • Added final_verify() method and PartialEq/Eq implementations for MillerLoopResult
  • Removed rust-toolchain file to rely on rust-version in Cargo.toml

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/pairing.rs Extracts Miller loop into separate function, adds final_verify method and equality traits to MillerLoopResult, improves documentation
rust-toolchain Removes toolchain specification file to use Cargo.toml MSRV

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant