Skip to content

Commit

Permalink
Merge branch 'master' into inherit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyush authored Mar 5, 2025
2 parents 8d07b42 + 9c3cc53 commit b4550d7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ff/src/fields/models/fp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,14 @@ impl<P: FpConfig<N>, const N: usize> Field for Fp<P, N> {

#[inline]
fn legendre(&self) -> LegendreSymbol {
use crate::fields::LegendreSymbol::*;

// s = self^((MODULUS - 1) // 2)
let s = self.pow(Self::MODULUS_MINUS_ONE_DIV_TWO);
if s.is_zero() {
Zero
LegendreSymbol::Zero
} else if s.is_one() {
QuadraticResidue
LegendreSymbol::QuadraticResidue
} else {
QuadraticNonResidue
LegendreSymbol::QuadraticNonResidue
}
}

Expand Down

0 comments on commit b4550d7

Please sign in to comment.