public static AltBn128Fq12Point twist(final AltBn128Fq2Point p) {
    final Fq2 x = p.getX();
    final Fq2 y = p.getY();

    final Fq[] xCoeffs = x.getCoefficients();
    final Fq[] yCoeffs = y.getCoefficients();

    final Fq[] nX = new Fq[Fq12.DEGREE];
    Arrays.fill(nX, Fq.zero());
    nX[0] = xCoeffs[0].subtract(xCoeffs[1].multiply(9));
    nX[6] = xCoeffs[1];
    final Fq[] nY = new Fq[Fq12.DEGREE];
    Arrays.fill(nY, Fq.zero());
    nY[0] = yCoeffs[0].subtract(yCoeffs[1].multiply(9));
    nY[6] = yCoeffs[1];

    final Fq12 newX = new Fq12(nX);
    final Fq12 newY = new Fq12(nY);
    final Fq12 w = w();
    return new AltBn128Fq12Point(newX.multiply(w.power(2)), newY.multiply(w.power(3)));
  }
Twist alt bn 128 fq 12 point.

@param p the p
@return the alt bn 128 fq 12 point
crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq12Point.java