| 6 | use serdes::ExpSerde; |
| 7 | |
| 8 | pub trait Field: FieldArith + ExpSerde { |
| 9 | fn optimistic_inv(&self) -> Option<Self> { |
| 10 | if self.is_zero() { |
| 11 | None |
| 12 | } else if *self == Self::ONE { |
| 13 | Some(Self::ONE) |
| 14 | } else { |
| 15 | self.inv() |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | impl Field for BN254Fr {} |
| 21 | impl Field for GF2 {} |
no outgoing calls
no test coverage detected