Can we get either a reference paper/article from which the author created the BCH library here, or alternatively, a mapping from the notation used in the code here to the notation in the Wikipedia article on BCH code? Also, it appears that this BCH library is narrow-sense but not primitive in the sense defined in the Wikipedia article. Is this in fact the case?