# is there a inverse polynomial for the CRC generator polynomial

Discussion in 'C Programming' started by Chen L., Jul 5, 2004.

1. ### Chen L.Guest

Hi all,

If I have a 32-bit data M, and the CRC genrator polynomial G(x),which
power is 32, then I can get the CRC checkword R by the following
algorithm:
X^32*M(x) = Q(x)G(x) + R(x),
But how is the inversed process, if I have get the R(x), is there a
inverse polynomial to generator the M(x)?

Another example is that I have a 32-bit data sequence D0,D1,D2,D3,
with the G(x), I can get the CRC checkword. If have known the
D1,D2,D3,CRC, how to define D0, if the quotient Q(x) could be defined
by some way.

Thanks a lot.

Chen L.

Chen L., Jul 5, 2004

2. ### Jack KleinGuest

First your question has nothing at all to do with the C language, in
fact does not even mention it at all. You are asking about an
algorithm, for which you should try Off the
top of my head, I am not sure what you want to do is possible or not.

Once you have selected an algorithm, assuming there is one that can do
what you want, if you have trouble implementing it in standard C, post

Jack Klein, Jul 5, 2004

3. ### Dik T. WinterGuest

Not a C question, but a mathematics question. And the answer is, off-hand,
yes. Set x = 2, we get the equation 2^32.M = Q.G + R, with known G and R.
Or more simple, Q.G = -R mod (2^32). Because of the choice of G, it is
invertable in the ring mod (2^32), and so we get a solution for Q, and
also of M. So find the inverse of G mod (2^32) and you are done.

Dik T. Winter, Jul 6, 2004