Skip to content

Conversation

@carloskiki
Copy link

This updates versions of many dependencies, and also updates the crate version.

Copilot AI review requested due to automatic review settings November 3, 2025 23:03
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 migrates from the deprecated random() method to the new try_from_rng() method across all Field and Group implementations, aligning with updates to the ff and group traits. The change updates to pre-release versions of dependencies (ff 0.14.0-pre.0, group 0.14.0-pre.0, pairing 0.24.0-pre.0, and rand_core 0.9) and removes the rust-toolchain file to allow more flexibility in Rust version selection.

Key changes:

  • Replaced Field::random(impl RngCore) with Field::try_from_rng(&mut R: TryRngCore + ?Sized) across scalar and field point implementations
  • Replaced Group::random(impl RngCore) with Group::try_from_rng(&mut R: TryRngCore + ?Sized) for group elements (G1, G2, Gt)
  • Updated dependencies to pre-release versions with breaking trait changes

Reviewed Changes

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

Show a summary per file
File Description
src/scalar.rs Replaced Field::random with Field::try_from_rng for Scalar, using try_next_u64 instead of next_u64
src/gt.rs Replaced Group::random with Group::try_from_rng for Gt and removed unused RngCore import
src/g2.rs Replaced Group::random with Group::try_from_rng for G2Projective, reordered methods, changed to try_fill_bytes
src/g1.rs Replaced Group::random with Group::try_from_rng for G1Projective, changed to try_fill_bytes
src/fp6.rs Replaced Field::random with Field::try_from_rng for Fp6, propagating try_from_rng calls
src/fp2.rs Replaced Field::random with Field::try_from_rng for Fp2, propagating try_from_rng calls
src/fp12.rs Replaced Field::random with Field::try_from_rng for Fp12, propagating try_from_rng calls
src/fp.rs Replaced Field::random with Field::try_from_rng for Fp, using try_next_u64 instead of next_u64
rust-toolchain Removed file, allowing flexible Rust version selection
Cargo.toml Updated version to 0.8.0-pre.0 and upgraded dependencies to pre-release versions
Comments suppressed due to low confidence (7)

src/fp.rs:11

  • The RngCore import is no longer used in this file since the implementation now only uses rand_core::TryRngCore. This unused import should be removed to maintain code cleanliness.
use rand_core::RngCore;

src/fp2.rs:11

  • The RngCore import is no longer used in this file since the implementation now only uses rand_core::TryRngCore. This unused import should be removed to maintain code cleanliness.
use rand_core::RngCore;

src/fp6.rs:16

  • The RngCore import is no longer used in this file since the implementation now only uses rand_core::TryRngCore. This unused import should be removed to maintain code cleanliness.
use rand_core::RngCore;

src/fp12.rs:11

  • The RngCore import is no longer used in this file since the implementation now only uses rand_core::TryRngCore. This unused import should be removed to maintain code cleanliness.
use rand_core::RngCore;

src/scalar.rs:16

  • The RngCore import is no longer used in this file since the implementation now only uses rand_core::TryRngCore. This unused import should be removed to maintain code cleanliness.
use rand_core::RngCore;

src/g1.rs:16

  • The RngCore import is no longer used in this file since the implementation now only uses rand_core::TryRngCore. This unused import should be removed to maintain code cleanliness.
use rand_core::RngCore;

src/g2.rs:15

  • The RngCore import is no longer used in this file since the implementation now only uses rand_core::TryRngCore. This unused import should be removed to maintain code cleanliness.
use rand_core::RngCore;

💡 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