Trait mina_curves::pasta::fields::SquareRootField
source · pub trait SquareRootField: Field {
// Required methods
fn legendre(&self) -> LegendreSymbol;
fn sqrt(&self) -> Option<Self>;
fn sqrt_in_place(&mut self) -> Option<&mut Self>;
}
Expand description
The interface for a field that supports an efficient square-root operation.
Required Methods§
sourcefn legendre(&self) -> LegendreSymbol
fn legendre(&self) -> LegendreSymbol
Returns a LegendreSymbol
, which indicates whether this field element is
1 : a quadratic residue
0 : equal to 0
-1 : a quadratic non-residue
sourcefn sqrt_in_place(&mut self) -> Option<&mut Self>
fn sqrt_in_place(&mut self) -> Option<&mut Self>
Sets self
to be the square root of self
, if it exists.