mulByX method

Multiply this point by BLS_X using double-and-add

Implementation

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

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

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

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