Skip to content

Commit 8deb089

Browse files
committed
use precompute for verification
this was originally part of the jacobi code (merged just before this commit) but was unintentionally dropped during rebases
1 parent feecedd commit 8deb089

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ecdsa/ellipticcurve.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,10 @@ def mul_add(self, self_mul, other, other_mul):
534534
return other * other_mul
535535
if not isinstance(other, PointJacobi):
536536
other = PointJacobi.from_affine(other)
537+
# when the points have precomputed answers, then multiplying them alone
538+
# is faster (as it uses NAF)
539+
if self.__precompute and other.__precompute:
540+
return self * self_mul + other * other_mul
537541

538542
if self.__order:
539543
self_mul = self_mul % self.__order

0 commit comments

Comments
 (0)