use ark_ff::Field;
pub mod fp;
pub use self::fp::*;
pub mod fq;
pub use self::fq::*;
pub mod fft;
#[derive(Debug, PartialEq)]
pub enum LegendreSymbol {
Zero = 0,
QuadraticResidue = 1,
QuadraticNonResidue = -1,
}
impl LegendreSymbol {
pub fn is_zero(&self) -> bool {
*self == LegendreSymbol::Zero
}
pub fn is_qnr(&self) -> bool {
*self == LegendreSymbol::QuadraticNonResidue
}
pub fn is_qr(&self) -> bool {
*self == LegendreSymbol::QuadraticResidue
}
}
pub trait SquareRootField: Field {
fn legendre(&self) -> LegendreSymbol;
#[must_use]
fn sqrt(&self) -> Option<Self>;
fn sqrt_in_place(&mut self) -> Option<&mut Self>;
}