title: BigInteger as neutral symbol
body: <p>I am currently working on an algorithm related to cryptography. More specifically, adding points on an elliptic curve. There is an option where I have to handle a situation like adding a point for example P(x,y) = (1,4) and some symbol for the neutral point e.g. Q=(e, e). The result of such &quot;addition&quot; should be Point (1,4). It (e) cannot be a zero value, because then the point will be Q(qx,qy)=(0,0) and another function will be activated, therefore the result will also differ. Can you assign a symbol to BigInteger?
  I need something like</p>
  <pre><code>if(qx == e){
    BigInteger r1 = x1;
    BigInteger r2 = x2;
  }
  </code></pre>
  <p>Here is full function:</p>
  <pre><code>static void addPoints(BigInteger x1, BigInteger y1, BigInteger x2, BigInteger y2, BigInteger a, BigInteger b, BigInteger p) throws Exception {
          BigInteger lambda = null;
          BigInteger x3 = null;
          BigInteger y3 = null;
         
          if (x1.compareTo(x2) == 0 &amp;&amp; y1.compareTo(y2) == 0) { //same points
              lambda = (((new BigInteger(&quot;3&quot;).multiply(x1.pow(2))).add(a))
                      .multiply(Modul1.getReverseNumber(
                              (new BigInteger(&quot;2&quot;).multiply(y1)), p)))
                      .mod(p);
  
              x3 = ((lambda.pow(2)).subtract(new BigInteger(&quot;2&quot;).multiply(x1))).mod(p);
              y3 = ((lambda.multiply(x1.subtract(x3))).subtract(y1)).mod(p);
  
          } else if (x1.compareTo(x2) != 0) { //points are diffrent
              lambda = ((y2.subtract(y1)).multiply(
                      Modul1.getReverseNumber(x2.subtract(x1), p)
              )).mod(p);
  
              x3 = (((lambda.pow(2)).subtract(x1)).subtract(x2)).mod(p);
              y3 = ((lambda.multiply(x1.subtract(x3))).subtract(y1)).mod(p);
  
          } else if (x1.compareTo(x2) == 0 &amp;&amp; y1.compareTo(p.subtract(y2)) == 0) { //y2 is negate
              System.out.println(O);
          } else { //Point add Neutral Point
              System.out.println(&quot;Punkt P + neutral : (&quot; + x1 + &quot;,&quot; + y1 + &quot;)&quot;);
          }
      }
  </code></pre>