From f3537bcd1c16a5ce48022e3eb948578fae4204c6 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Sun, 2 Mar 2025 21:37:03 -0800 Subject: [PATCH] Relax `Sized` requirements on the rng --- CHANGELOG.md | 3 +++ src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3276d5c..f8c7b05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this library adheres to Rust's notion of ### Changed - MSRV is now 1.63.0. - Migrated to `ff 0.14`, `rand_core 0.9`. +- `group::Group::random(rng: impl RngCore) -> Self` has been changed to + `Group::random(rng: &mut R) -> Self`, to enable passing a + trait object as the RNG. ## [0.13.0] - 2022-12-06 ### Changed diff --git a/src/lib.rs b/src/lib.rs index 27ed5c9..b59c590 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,7 @@ pub trait Group: /// this group. /// /// This function is non-deterministic, and samples from the user-provided RNG. - fn random(rng: impl RngCore) -> Self; + fn random(rng: &mut R) -> Self; /// Returns the additive identity, also known as the "neutral element". fn identity() -> Self;