Skip to content

Commit

Permalink
adds a Field::try_from_rng method
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo committed Feb 26, 2025
1 parent 4ae604c commit 72a85c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ pub trait Field:
/// Returns an element chosen uniformly at random using a user-provided RNG.
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self;

/// Returns an element chosen uniformly at random using a user-provided RNG.
fn try_from_rng<R: TryRngCore + ?Sized>(rng: &mut R) -> Self;

/// Returns true iff this element is zero.
fn is_zero(&self) -> Choice {
self.ct_eq(&Self::ZERO)
Expand Down

0 comments on commit 72a85c2

Please sign in to comment.