mulByX method

Multiply by BLS_X, using double and add.

Implementation

G2NativeProjective mulByX() {
  G2NativeProjective result = G2NativeProjective.identity();

  BigInt x = BigInt.parse("0xd201000000010000") >> 1; // skip the first bit
  G2NativeProjective tmp = this;

  while (x != BigInt.zero) {
    tmp = tmp.double();

    if ((x & BigInt.one) == BigInt.one) {
      result = result + tmp;
    }
    x >>= 1;
  }
  return -result;
}