Skip to content

Commit 86ad465

Browse files
Correct check for anomalous curves
1 parent 538f50e commit 86ad465

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/sage/schemes/elliptic_curves/ell_point.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3605,11 +3605,10 @@ def discrete_log(self, Q, ord=None):
36053605
raise ValueError('ECDLog problem has no solution (order of Q does not divide order of P)')
36063606
E = self.curve()
36073607
F = E.base_ring()
3608-
if F.is_prime_field():
3609-
p = F.cardinality()
3610-
if n == p:
3611-
# Anomalous case
3612-
return self.padic_elliptic_logarithm(Q, p)
3608+
p = F.cardinality()
3609+
if F.is_prime_field() and n == p:
3610+
# Anomalous case
3611+
return self.padic_elliptic_logarithm(Q, p)
36133612
elif hasattr(E, '_order') and E._order.gcd(n**2) == n:
36143613
pass # cyclic rational n-torsion -> okay
36153614
elif self.weil_pairing(Q, n) != 1:

0 commit comments

Comments
 (0)