ff: PrimeField::{is_even, is_odd}

This commit is contained in:
Jack Grigg 2020-04-21 19:05:19 +12:00
parent 43573a953b
commit 027cb982dc
1 changed files with 4 additions and 0 deletions

View File

@ -332,6 +332,10 @@ impl PrimeField for Fr {
FrRepr::from(*self)
}
fn is_odd(&self) -> bool {
(self.0).0 % 2 != 0
}
fn char() -> FrRepr {
Fr(MODULUS_R).into()
}