Skip to content

Commit

Permalink
Make Field::is_zero a provided method
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Sep 1, 2021
1 parent 5564831 commit 0c657f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ pub trait Field:
fn one() -> Self;

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

/// Returns true iff this element is zero.
///
Expand Down

0 comments on commit 0c657f3

Please sign in to comment.