Skip to content

Commit

Permalink
remove workaround for sagemath#38350 since sagemath#38359 seems to be…
Browse files Browse the repository at this point in the history
… happening
  • Loading branch information
yyyyx4 committed Jul 17, 2024
1 parent ecbdd70 commit 85ff4df
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/sage/schemes/elliptic_curves/ell_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -4075,25 +4075,14 @@ def log(self, base):
else:
v = self.weil_pairing(P2, n)
w = P1.weil_pairing(self, n)
try:
x0, y0 = v.log(z, o), w.log(z, o)
except TypeError:
# not all implementations of finite-field elements support passing the order in .log()
# known bug -- fixing #38350 will eliminate the need for this try-except
x0, y0 = v.log(z), w.log(z)
x0, y0 = v.log(z, o), w.log(z, o)

T = self - x0*P1 - y0*P2
if not T:
return x0, y0

try:
x1 = (n//n1 * T).log(o*P1, n1)
y1 = (n//n2 * T).log(o*P2, n2)
except TypeError:
# not all implementations of finite-field elements support passing the order in .log()
# known bug -- fixing #38350 will eliminate the need for this try-except
x1 = (n//n1 * T).log(o*P1)
y1 = (n//n2 * T).log(o*P2)
x1 = (n//n1 * T).log(o*P1, n1)
y1 = (n//n2 * T).log(o*P2, n2)

# assert n//n1 * self == (x1*o + n//n1*x0) * P1 + n//n1*y0 * P2
# assert n//n2 * self == n//n2*x0 * P1 + (y1*o + n//n2*y0) * P2
Expand Down

0 comments on commit 85ff4df

Please sign in to comment.