point_addition(P: tuple[int, int], Q: tuple[int, int], a: int, b: int) -> tuple[int, int]
This function takes in \( P \) and \( Q \) as points and integers \( a \) and \( b \) as variables to the following equation.
\( y^2=x^3+ax+b \)
Which is called Weierstrass normal form. \( P \) and \( Q \) are then the movable points on the graph below with the result being the green point on the curve which is the addition between \( P \) and \( Q \) on the curve defined by \( a \) and \( b \).
point_multiplication(P: tuple[int, int], k: int, a: int, b: int) -> tuple[float, float]
\( P \) is a point on the curve defined by \( a \) and \( b \) as variables in the equation \( y^2=x^3+ax+b \). The scalar defined by \( k \) is applied to \( P \) using the double-and-add method. For the double-and-add method, \( Q \) is also defined to be a point at infinity. The algorithm is defined as if the integer \( k \) is even, add \( P \) to itself, then divide \( k \) by 2, and if \( k \) is odd, then add \( P \) to \( Q \). Once \( k \) reaches 0, then the algorithm terminates.
point_addition_mod(P: tuple[int, int], Q: tuple[int, int], a: int, b: int, mod: int) -> tuple[int, int]
\( P \) and \( Q \) are unique points on the curve defined by the variables \( a \) and \( b \) in the equation \( y^2=x^3+ax+b \) which is called Weierstrass normal form. \( mod \) is then the modulus that the computation takes place in to in the finite field \( \mathbb{F}_{mod} \).
point_multiplication_mod(P: tuple[int, int], k: int, a: int, b: int, mod: int) -> tuple[int, int]
\( P \) a point on the curve defined by the variables \( a \) and \( b \) in the equation \( y^2=x^3+ax+b \) which is called Weierstrass normal form. \( mod \) is then the modulus that the computation takes place in to in the finite field \( \mathbb{F}_{mod} \). The scalar defined by \( k \) is applied to \( P \) using the double-and-add method. For the double-and-add method, \( Q \) is also defined to be a point at infinity. The algorithm is defined as if the integer \( k \) is even, add \( P \) to itself, then divide \( k \) by 2, and if \( k \) is odd, then add \( P \) to \( Q \). Once \( k \) reaches 0, then the algorithm terminates. All of the computation takes place \( \mod mod \) to ensure that the results stay in the finite field \( \mathbb{F}_{mod} \).