square method

Bls12NativeFp12 square()

Squaring

Implementation

Bls12NativeFp12 square() {
  Bls12NativeFp6 ab = this.c0 * this.c1;
  Bls12NativeFp6 c0c1 = this.c0 + this.c1;
  Bls12NativeFp6 c0 = this.c1.mulByNonresidue();
  c0 = c0 + this.c0;
  c0 = c0 * c0c1;
  c0 = c0 - ab;
  Bls12NativeFp6 c1 = ab + ab;
  c0 = c0 - ab.mulByNonresidue();

  return Bls12NativeFp12(c0: c0, c1: c1);
}