operator unary- method

EDPoint operator unary-()

Negation operator for an Edwards curve point.

This operator computes the negation (negate y-coordinate) of the Edwards curve point and returns a new Edwards curve point representing the negated point.

Returns:

  • A new Edwards curve point representing the negation of this point.

Implementation

EDPoint operator -() {
  final BigInt x1 = _coords[0];
  final BigInt y1 = _coords[1];
  final BigInt t1 = _coords[3];
  final BigInt p = curve.p;

  return EDPoint._(curve, [x1, (p - y1) % p, _coords[2], (p - t1) % p],
      order: order);
}