I am trying to write a SageMath script that multiplies two coordinates on Elliptic Curves into one common coordinate.

SageMath Elliptic curves over finite fields documentation

p = Number

M1 = EllipticCurve (GF (p), [0,7])

C1 = M1 ([x1, y1])
C2 = M1 ([x2, y2])
C3 = C1 * C2

Somewhere they wrote that using sets of the SageMath function it is possible to do this. How to do it?

  • 2
    $\begingroup$ Before computing something, one must have a clear picture of what it is. We can add two points on an Elliptic Curve. We can multiply a point on an Elliptic curve by an integer (that's mathematically defined by repeated addition, and well-defined since addition is associative). But there is no common definition of the multiplication of two points on an Elliptic Curve, unless we also mention a generator $G$, in which case we can define that $C_1=c_1⋅G$ and $C_2=c_2⋅G$ implies by definition that $C_1*C_2=(c_1×c_2)⋅G$ where $×$ is modular multiplication modulo the order $n$ of $G$. $\endgroup$
    – fgrieu
    Commented Oct 20, 2021 at 5:09
  • 1
    $\begingroup$ If you're trying to find an implementation of the elliptic curve group law in sagemath, it uses the "+" operator. In other words, C3=C1+C2 will set C3 equal to the combination of C1 and C2 under the elliptic curve group law. $\endgroup$
    – Daniel S
    Commented Oct 20, 2021 at 9:38
  • $\begingroup$ @DanielS How do I write " + "operator and this whole formula in SageMath? $\endgroup$
    – Dew Debra
    Commented Oct 20, 2021 at 9:43
  • 2
    $\begingroup$ For addition: C3 = C1 + C2 this works since you defined C1 and C1 as points. For multiplication: Does this answer your question? How do I multiply two points on an elliptic curve?, If not, please indicate your actual aim. $\endgroup$
    – kelalaka
    Commented Oct 20, 2021 at 10:04
  • $\begingroup$ You can always edit your document and comment below to get it reopened, assuming of course that there is then enough information to distinguish it from the other Q/A. $\endgroup$
    – Maarten Bodewes
    Commented Oct 20, 2021 at 13:33