Skip to content

Commit

Permalink
cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
fametrano committed Aug 30, 2020
1 parent 666e3f6 commit 4f7b6e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions btclib/curvegroup.py
Expand Up @@ -386,15 +386,15 @@ def _mult_aff(m: int, Q: Point, ec: CurveGroup) -> Point:
# if least significant bit of m is 1, then add Q to R[0]
R[0] = R[m & 1]
# remove the bit just accounted for
m = m >> 1
m >>= 1
while m > 0:
# the doubling part of 'double & add'
Q = ec._double_aff(Q)
# always perform the 'add', even if useless, to be constant-time
R[1] = ec._add_aff(R[0], Q)
# if least significant bit of m is 1, then add Q to R[0]
R[0] = R[m & 1]
m = m >> 1
m >>= 1
return R[0]


Expand All @@ -419,15 +419,15 @@ def _mult_jac(m: int, Q: JacPoint, ec: CurveGroup) -> JacPoint:
# if least significant bit of m is 1, then add Q to R[0]
R[0] = R[m & 1]
# remove the bit just accounted for
m = m >> 1
m >>= 1
while m > 0:
# the doubling part of 'double & add'
Q = ec._double_jac(Q)
# always perform the 'add', even if useless, to be constant-time
R[1] = ec._add_jac(R[0], Q)
# if least significant bit of m is 1, then add Q to R[0]
R[0] = R[m & 1]
m = m >> 1
m >>= 1
return R[0]


Expand Down

0 comments on commit 4f7b6e2

Please sign in to comment.