Hello all,

I’ve the task of implementing the following CRC computation and was wondering whether I could use boost::crc to save me a lot of hassle. 

 

------------------------

Default 32-bit Parity (CRC)

 

This 32-bit CRC is the same as that described in EKMS 304 ([6]) and EKMS 322 ([8]) and could be used as a CRC method in the keyAlgorithm Attribute (with OID { 1 2 826 0 1145 0 5 1 }). Let g(x) be the polynomial x32 + x22 + x2 + x + 1. Let d(x) be the k bits of data to have parity applied to them. The first bit of data is the coefficient of the (k-1)st power of x etc. Let f(x) be the polynomial naturally represented by the initial fill 0xF8DD4258, i.e. x31 + x30 + x29 + x28 + x27 + x23 + x22 + x20 + x19 + x18 + x16 + x14 + x9 + x6 + x4 + x3. Then the output is

 

c(x) = x32d(x) + xkf(x) mod g(x).

 

The polynomial c(x) is then interpreted as a stream with the coefficient of x31 coming first and the coefficient of x0 coming last. The 32-bit parity is then c(x).

 

This calculation can be done using a simple shift register as shown below. The shaded stages represent ones in the initial fill. The logic steps k times to determine c(x), which is the final state of the register.

<diagram omitted>

------------------------

 

Any advice and or help would be appreciated.

Regards,

Paul

 

 

 

 

This email and any files transmitted with it may be confidential, legally privileged and protected in law and are intended solely for the use of the individual to whom it is addressed. Any view or opinions presented are solely those of the author and do not necessarily represent those of Stonewood Group Ltd.   If you have received this Email in error please contact the sender by return and confirm that its contents have been destroyed without further distribution or disclosure. Please email admin@stonewood.co.uk with any questions relating to this disclaimer.

Stonewood Group Ltd has Registered Offices at Sandford Lane, Wareham, Dorset BH20 4DY. The company is registered in England and Wales under no: 3007498.