Skip to content

Commit

Permalink
use precompute for verification
Browse files Browse the repository at this point in the history
this was originally part of the jacobi code (merged just before this
commit) but was unintentionally dropped during rebases
  • Loading branch information
tomato42 committed Dec 2, 2019
1 parent feecedd commit 8deb089
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ecdsa/ellipticcurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@ def mul_add(self, self_mul, other, other_mul):
return other * other_mul
if not isinstance(other, PointJacobi):
other = PointJacobi.from_affine(other)
# when the points have precomputed answers, then multiplying them alone
# is faster (as it uses NAF)
if self.__precompute and other.__precompute:
return self * self_mul + other * other_mul

if self.__order:
self_mul = self_mul % self.__order
Expand Down

0 comments on commit 8deb089

Please sign in to comment.