syndromes method

List<GfValue> syndromes(
  1. BigInt codeword
)

Evaluates the consecutive BCH syndromes of a received codeword.

The returned values correspond to roots alpha^firstRoot through alpha^(firstRoot + designedDistance - 2).

Implementation

List<GfValue> syndromes(BigInt codeword) {
  if (codeword.isNegative || codeword.bitLength > length) {
    throw ArgumentError.value(codeword, 'codeword');
  }

  return [
    for (var root = firstRoot;
        root < firstRoot + designedDistance - 1;
        root++)
      _evaluateAt(codeword, root % fullLength),
  ];
}