secp256k1GeTableSetGlobalz static method

void secp256k1GeTableSetGlobalz(
  1. int len,
  2. List<Secp256k1Ge> a,
  3. List<Secp256k1Fe> zr
)

Implementation

static void secp256k1GeTableSetGlobalz(
    int len, List<Secp256k1Ge> a, List<Secp256k1Fe> zr) {
  int i;
  Secp256k1Fe zs = Secp256k1Fe();
  if (len > 0) {
    i = len - 1;

    /// Ensure all y values are in weak normal form for fast negation of points
    secp256k1FeNormalizeWeak(a[i].y);
    zs = zr[i].clone();

    /// Work our way backwards, using the z-ratios to scale the x/y values.
    while (i > 0) {
      if (i != len - 1) {
        secp256k1FeMul(zs, zs, zr[i]);
      }
      i--;
      secp256k1GeSetGeZinv(a[i], a[i], zs);
    }
  }
}