mod method

Implementation

QRPolynomial mod(QRPolynomial e) {
  if (length - e.length < 0) {
    // ignore: avoid_returning_this
    return this;
  }

  final ratio = qr_math.glog(this[0]) - qr_math.glog(e[0]);

  final value = Uint8List(length);

  for (var i = 0; i < length; i++) {
    value[i] = this[i];
  }

  for (var i = 0; i < e.length; i++) {
    value[i] ^= qr_math.gexp(qr_math.glog(e[i]) + ratio);
  }

  // recursive call
  return QRPolynomial(value, 0).mod(e);
}