Skip to content

Commit

Permalink
Update _calculate.py to fix square root computations.
Browse files Browse the repository at this point in the history
  • Loading branch information
TDQuering authored Nov 22, 2024
1 parent c945356 commit 49cacb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/galois/_domains/_calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,12 @@ def implementation(self, a: Array) -> Array:
)

p = self.field.characteristic
q = self.field.order

if p % 4 == 3:
if q % 4 == 3:
roots = a ** ((self.field.order + 1) // 4)

elif p % 8 == 5:
elif q % 8 == 5:
d = a ** ((self.field.order - 1) // 4)
roots = self.field.Zeros(a.shape)

Expand Down

0 comments on commit 49cacb9

Please sign in to comment.