Fix dalek_ff_group invert

This commit is contained in:
Luke Parker 2022-07-08 16:05:17 -04:00
parent 41eaa1b124
commit f50fd76b31
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6

View file

@ -166,7 +166,7 @@ impl Field for Scalar {
fn square(&self) -> Self { *self * self }
fn double(&self) -> Self { *self + self }
fn invert(&self) -> CtOption<Self> {
CtOption::new(Self(self.0.invert()), self.is_zero())
CtOption::new(Self(self.0.invert()), !self.is_zero())
}
fn sqrt(&self) -> CtOption<Self> { unimplemented!() }
fn is_zero(&self) -> Choice { self.0.ct_eq(&DScalar::zero()) }