pow method

Bls12Fp pow(
  1. List<BigInt> by
)

pow

Implementation

Bls12Fp pow(List<BigInt> by) {
  Bls12Fp res = Bls12Fp.one();
  for (BigInt e in by.reversed) {
    for (int i = 63; i >= 0; i--) {
      res = res.square();

      if (((e >> i) & BigInt.one) == BigInt.one) {
        res = res * this;
      }
    }
  }
  return res;
}