Reed Solomon Polynomial Generator I am developing a sample program to generate a 2D Barcode, using Reed-Solomon error correction codes. By going through this article, I am developing the program. But I couldn't understand how he generated the generator polynomial.
Can anybody explain how they generated the generator polynomial? Please guide me to complete this correction step.
 A: Taking a special case of more general results, the generator polynomial of a 
cyclic $(n, n-2t)$ Reed-Solomon code over GF$(q)$, the finite field of $q$ elements,
is of the form
$$g(x) = g_0 + g_1x + \cdots + g_{2t}x^{2t} = (x-\alpha)(x - \alpha^2)\cdots (x-\alpha^{2t})$$ 
where $n$ is the number of symbols in a codeword, $t$ is the number of errors 
that can be corrected, and $\alpha$ is a primitive $n$-th root of unity in the field.
In OP Sunny's special case, $q = 2^8 = 256$, $n = 255$ and $\alpha$ is a primitive element
of the field.  The elements of GF$(256)$ can be stored as $8$-bit bytes, and addition
in the field is the bit-by-bit Exclusive OR operation which is typically included
as a machine instruction on most processors.  Also, we can replace the minus signs in the above expression by plus signs since addition and subtraction are the same operation in any GF$(2^n)$.
OP Sunny's question seems to be: how do I compute the coefficients 
$g_i, 0 \leq i \leq 2t$?  The obvious answer is of course to multiply
the given factors together (which is what the article that he refers
to tells him to do), but since he seems to be unsure about how
to do this, here is an iterative procedure for it.  
Suppose that the
coefficients are to be stored in a $(2t+1)$-byte array g with g[i] 
storing $g_i$, with g[0] initialized to $1$ and all other g[i] to $0$.
The elements $\alpha, \alpha^2,\cdots, \alpha^{2t}$ are stored in a $2t$-byte
array alpha with alpha[i] storing $\alpha^i$.  Assume that we have a
program mult(x,y) that takes two bytes $x$ and $y$ representing elements
of GF$(256)$ as input and returns the byte
value of the product of $x$ and $y$ in GF$(256)$. Then, the coefficients
$g_i$ are obtained in g via the following calculation:
for i = 1 step 1 until 2t do
     begin
     for j = 2t step -1 until 1 do
           begin
           g[j] = mult(g[j], alpha[i]) XOR g[j-1]
           end
     g[0] = mult(g[0]), alpha[i])
     end

This seems to be getting off-topic a bit for math.SE but I suspect 
that the folks on the StackOverflow.SE etc are not too familiar with
finite field arithmetic and the likes.
