PET-Exercises icon indicating copy to clipboard operation
PET-Exercises copied to clipboard

Redundant arguments in point_add(a, b, p, x0, y0, x1, y1)?

Open ralienpp opened this issue 8 years ago • 0 comments

Hello, I would like to ask about the reasoning for having

  1. a and b in the function's prototype, when the formula for calculating the sum of two points does not require them (it only needs the coordinates of both points and p). Is this to perform a sanity check and verify whether the points are on the curve before attempting to add them?

  2. p is required, according to the formula in the function's docstring, and hence the function expects this parameter as well. However, if I look into various sources that explain how this works (e.g. https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication#Point_addition) then there is no mod p component there. Why is it required here?

This is the function I refer to: https://github.com/gdanezis/PET-Exercises/blob/master/Lab01Basics/Lab01Code.py#L91

ralienpp avatar Feb 14 '17 09:02 ralienpp