Skip to content

Commit

Permalink
Fix huge mistake in scalar_mult().
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacorbellini committed Jun 8, 2015
1 parent 1206ca4 commit 57e1389
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/ecdhe.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def scalar_mult(k, point):
"""Returns k * point computed using the double and point_add algorithm."""
assert is_on_curve(point)

if k % curve.p == 0 or point is None:
if k % curve.n == 0 or point is None:
return None

if k < 0:
Expand Down
2 changes: 1 addition & 1 deletion scripts/ecdsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def scalar_mult(k, point):
"""Returns k * point computed using the double and point_add algorithm."""
assert is_on_curve(point)

if k % curve.p == 0 or point is None:
if k % curve.n == 0 or point is None:
return None

if k < 0:
Expand Down

0 comments on commit 57e1389

Please sign in to comment.