diff --git a/scripts/ecdhe.py b/scripts/ecdhe.py index 3b891da74e1..383afc1a0ce 100755 --- a/scripts/ecdhe.py +++ b/scripts/ecdhe.py @@ -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: diff --git a/scripts/ecdsa.py b/scripts/ecdsa.py index 71fad300cf7..c50d379b0e0 100755 --- a/scripts/ecdsa.py +++ b/scripts/ecdsa.py @@ -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: