CRC problem

Good morning.
I have problem with CRC. Math.lib has getcrc, but this function uses 1021 polynom without reverse initial data bytes and without reverse CRC result.
I need two functions for CRC: CRC-CCITT (polynom 1021) with reverse initial data bytes and reverse CRc result and CRC16 (polynom 8005) with reverse initial data bytes and reverse CRc result, too. How can i implement these functions? Are there other libraries with this implementations?

Thank you so much.


The source code for the CRC algorithm is available within Math.lib and you could copy it and edit it to create different polynomials. As for bit reversing, you might find that easier done in a wrapper function that pre-processes the array before calling the CRC routine, but the choice is yours. Bit reversal can be done very quickly by creating a lookup table with reversed values. You can see an example of this in sfspi_xbitrev function in SFLASH.lib