public boolean isOnCurve() {
    if (!x.isValid() || !y.isValid()) {
      return false;
    }

    if (isInfinity()) {
      return true;
    }

    final Fq2 x = getX();
    final Fq2 y = getY();

    return y.power(2).subtract(x.power(3)).equals(Fq2.b2());
  }
Is on curve boolean.

@return the boolean
crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq2Point.java