@@ -4075,25 +4075,14 @@ def log(self, base):
40754075 else :
40764076 v = self .weil_pairing (P2 , n )
40774077 w = P1 .weil_pairing (self , n )
4078- try :
4079- x0 , y0 = v .log (z , o ), w .log (z , o )
4080- except TypeError :
4081- # not all implementations of finite-field elements support passing the order in .log()
4082- # known bug -- fixing #38350 will eliminate the need for this try-except
4083- x0 , y0 = v .log (z ), w .log (z )
4078+ x0 , y0 = v .log (z , o ), w .log (z , o )
40844079
40854080 T = self - x0 * P1 - y0 * P2
40864081 if not T :
40874082 return x0 , y0
40884083
4089- try :
4090- x1 = (n // n1 * T ).log (o * P1 , n1 )
4091- y1 = (n // n2 * T ).log (o * P2 , n2 )
4092- except TypeError :
4093- # not all implementations of finite-field elements support passing the order in .log()
4094- # known bug -- fixing #38350 will eliminate the need for this try-except
4095- x1 = (n // n1 * T ).log (o * P1 )
4096- y1 = (n // n2 * T ).log (o * P2 )
4084+ x1 = (n // n1 * T ).log (o * P1 , n1 )
4085+ y1 = (n // n2 * T ).log (o * P2 , n2 )
40974086
40984087# assert n//n1 * self == (x1*o + n//n1*x0) * P1 + n//n1*y0 * P2
40994088# assert n//n2 * self == n//n2*x0 * P1 + (y1*o + n//n2*y0) * P2
0 commit comments