title: How do I add two curve25519 points
body: <p>I have two points ([32]byte) on curve25519. How do I add them (a + b). I obviously can't do it using big.Int, since they aren't numbers but points on the curve. I haven't found so far any library to do something similar to what I can do using <a href="https://github.com/FiloSottile/edwards25519/tree/c5477978affeeac681d1e732d1655e934625b479" rel="nofollow noreferrer">edwards25519</a>:</p>
  <pre class="lang-golang prettyprint-override"><code>a := [32]byte // I get that from another function
  b := [32]byte // also from another function
  pointA, _ := new(edwards25519.Point).SetBytes(a)
  pointB, _ := new(edwards25519.Point).SetBytes(b)
  pointC := pointA.Add(pointA, pointB)
  
  fmt.Println(pointC.Bytes())
  </code></pre>
  <p>I already tried using this and converting the result to the montgomery curve using <code>&amp;edwards25519.Point{}.BytesMontgomery()</code>, but I was not able to import neither <code>a</code> nor <code>b</code> into the edwards25519 curve, since they are points on the curve25519.</p>