This is a continuation of this post on SO.I am trying to implement an errata (errors-and-erasures) decoder for Reed-Solomon. My current approach is to use Berlekamp-Massey (because it's the most common algorithm and there are a lot of optimizations tricks that are known, but the Euclidian algorithm is very similar and should be pretty much the same for my case: same initialization variables and same output, only the calculation method is different).What I know:the common errors(-only) Berlekamp Massey to compute (only) the errors locator polynomial.how to extend standard BM to simultaneously compute the errors evaluator polynomial.how to extend standard BM to compute errata (errors-and-erasures) locator polynomial.What I don't know: how to mix both extensions, to simultaneously compute the errata (errors-and-erasures) evaluator polynomial. In fact what I think I miss is the initialization value for the errata evaluator support polynomial A (see below).To be clearer, here are some figures that describe the variations of BM that I cited above, from the book Algebraic codes for data transmission, Blahut, Richard E., 2003, Cambridge university press. (readable here, chapters 7.4 and 7.5):Standard (errors-only and locator polynomial Lambda only) BM:BM extension to simultaneously compute the evaluator polynomial (named Gamma):BM extension to decode errata (errors-and-erasures) but only locator polynomial:As of now, I just compute the erasures evaluator polynomial from the erasures locator polynomial, and I initialize Gamma = A = erasures evaluator polynomial (just like Lambda = B = erasures locator polynomial, see post on SO), but at the end of BM, the errata evaluator polynomial contains terms of too high order that should have been cancelled, for example:Gamma:  34x^11 + 187x^10 + 200x^9 + 43x^5 + 129x^4 + 5x^3 + 62x^2 + 8x + 1Instead of the correct:Gamma:  43x^5 + 129x^4 + 5x^3 + 62x^2 + 8x + 1I guess my initialization of the errata evaluator support polynomial A is wrong (when there's no erasures, Gamma = 1 and A = 0, here with erasures they are both initialized with the erasures evaluator polynomial), but I could not find any academic paper describing the initialization values.The only paper I have found describing an errata decoder computing simultaneously the locator and evaluator polynomials is using the Euclidian algorithm instead of BM (from Efficient algorithms for decoding Reed-Solomon codes with erasures, Todd Mateer, Clemson University, Clemson, SC (2014)):But here it seems they are just using the same approach I did: initializing Gamma and A (here Omega and little omega) with the erasures evaluator polynomial, and they just do some trimming inside the conditional branches and at the return of the algo by limiting the indices of Omega.Do someone know what values should Gamma and A be initialized with to avoid playing with the too high order terms trimming hack?
Initialization of errata evaluator polynomial for simultaneous computation in Berlekamp-Massey for Reed-Solomon
it.information theory