mulBy01 method

Bls12Fp6 mulBy01(
  1. Bls12Fp2 rhsC0,
  2. Bls12Fp2 rhsC1
)

Multiply by Bls12Fp2 elements in positions c0 and c1

Implementation

Bls12Fp6 mulBy01(Bls12Fp2 rhsC0, Bls12Fp2 rhsC1) {
  final aA = c0 * rhsC0;
  final bB = c1 * rhsC1;

  final t1 = (c2 * rhsC1).mulByNonresidue() + aA;
  final t2 = (c0 + c1) * (rhsC0 + rhsC1) - aA - bB;
  final t3 = c2 * rhsC0 + bB;

  return Bls12Fp6(c0: t1, c1: t2, c2: t3);
}