selectPoint function

void selectPoint(
  1. PreComputedGroupElement t,
  2. int pos,
  3. int b
)

Implementation

void selectPoint(PreComputedGroupElement t, int pos, int b) {
  var minusT = PreComputedGroupElement();
  var bNegative = negative(b);
  var bAbs = b - (((-bNegative) & b) << 1);

  t.Zero();
  for (var i = 0; i < 8; i++) {
    PreComputedGroupElementCMove(t, base[pos][i], equal(bAbs, i + 1));
  }
  FeCopy(minusT.yPlusX, t.yMinusX);
  FeCopy(minusT.yMinusX, t.yPlusX);
  FeNeg(minusT.xy2d, t.xy2d);
  PreComputedGroupElementCMove(t, minusT, bNegative);
}