code: function linComb_(x, y, a, b) {
    var i, c, k, kk;
    k=x.length<y.length ? x.length : y.length;
    kk=x.length;
    for (c=0, i=0; i<k; i++) {
      c+=a*x[i]+b*y[i];
      x[i]=c & mask;
      c>>=bpe;
    }
    for (i=k; i<kk; i++) {
      c+=a*x[i];
      x[i]=c & mask;
      c>>=bpe;
    }
  }
docs: do the linear combination x=a*x+b*y for bigInts x and y, and integers a and b. x must be large enough to hold the answer.