pub trait FieldExtensions {
// Required methods
fn try_sqrt(&self) -> Option<Self>
where Self: Sized;
fn legendre(&self) -> i32;
fn order(&self) -> Option<BigInt>;
// Provided method
fn is_quadratic_residue(&self) -> bool { ... }
}Expand description
Extension trait for optional field operations.
This trait provides operations that may not be available in all implementations or may have different performance characteristics.
Required Methods§
Sourcefn try_sqrt(&self) -> Option<Self>where
Self: Sized,
fn try_sqrt(&self) -> Option<Self>where
Self: Sized,
Attempt to compute the square root.
Returns Some(sqrt) if a square root exists, None otherwise.
This is an optional operation that may not be implemented by all backends.
Provided Methods§
Sourcefn is_quadratic_residue(&self) -> bool
fn is_quadratic_residue(&self) -> bool
Check if this element is a quadratic residue.