mulBy014 method

Implementation

Bls12NativeFp12 mulBy014(
  Bls12NativeFp2 c0,
  Bls12NativeFp2 c1,
  Bls12NativeFp2 c4,
) {
  // aa = this.c0 * (c0 + c1*u)
  final aa = this.c0.mulBy01(c0, c1);

  // bb = this.c1 * (c4*u)
  final bb = this.c1.mulBy1(c4);

  // o = c1 + c4
  final o = c1 + c4;

  // c1 = (this.c1 + this.c0) * (c0 + o*u)
  var c1_ = (this.c1 + this.c0).mulBy01(c0, o);

  // c1 = c1 - aa - bb
  c1_ = c1_ - aa - bb;

  // c0 = bb * nonresidue + aa
  var c0_ = bb.mulByNonresidue() + aa;

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