@@ -139,10 +139,10 @@ def __init__(self, generator, point, verify=True):
139139 raise InvalidPointError ("Generator point order is bad." )
140140
141141 def __eq__ (self , other ):
142- if isinstance (other , Public_key ):
142+ if isinstance (other , Public_key ):
143143 """Return True if the points are identical, False otherwise."""
144144 return self .curve == other .curve \
145- and self .point == other .point
145+ and self .point == other .point
146146 return NotImplemented
147147
148148 def verifies (self , hash , signature ):
@@ -182,12 +182,12 @@ def __init__(self, public_key, secret_multiplier):
182182
183183 self .public_key = public_key
184184 self .secret_multiplier = secret_multiplier
185-
185+
186186 def __eq__ (self , other ):
187- if isinstance (other , Private_key ):
187+ if isinstance (other , Private_key ):
188188 """Return True if the points are identical, False otherwise."""
189189 return self .public_key == other .public_key \
190- and self .secret_multiplier == other .secret_multiplier
190+ and self .secret_multiplier == other .secret_multiplier
191191 return NotImplemented
192192
193193 def sign (self , hash , random_k ):
@@ -220,8 +220,8 @@ def sign(self, hash, random_k):
220220 r = p1 .x () % n
221221 if r == 0 :
222222 raise RSZeroError ("amazingly unlucky random number r" )
223- s = (numbertheory .inverse_mod (k , n ) *
224- (hash + (self .secret_multiplier * r ) % n )) % n
223+ s = (numbertheory .inverse_mod (k , n )
224+ * (hash + (self .secret_multiplier * r ) % n )) % n
225225 if s == 0 :
226226 raise RSZeroError ("amazingly unlucky random number s" )
227227 return Signature (r , s )
@@ -277,8 +277,8 @@ def point_is_valid(generator, x, y):
277277 if not curve .contains_point (x , y ):
278278 return False
279279 if curve .cofactor () != 1 and \
280- not n * ellipticcurve .PointJacobi (curve , x , y , 1 )\
281- == ellipticcurve .INFINITY :
280+ not n * ellipticcurve .PointJacobi (curve , x , y , 1 )\
281+ == ellipticcurve .INFINITY :
282282 return False
283283 return True
284284
@@ -361,7 +361,7 @@ def point_is_valid(generator, x, y):
361361generator_secp256k1 = ellipticcurve .PointJacobi (
362362 curve_secp256k1 , _Gx , _Gy , 1 , _r , generator = True )
363363
364- # Brainpool P-160-r1
364+ # Brainpool P-160-r1
365365_a = 0x340E7BE2A280EB74E2BE61BADA745D97E8F7C300
366366_b = 0x1E589A8595423412134FAA2DBDEC95C8D8675E58
367367_p = 0xE95E4A5F737059DC60DFC7AD95B3D8139515620F
0 commit comments