Extension of a decoding algorithm from Reed-Solomon codes to BCH codes