Different zlib CRC Algorithms

Joakim Tjernlund joakim.tjernlund at lumentis.se
Tue Feb 4 12:06:45 EST 2003


> > >
> > > 	crc = (crc32(crc ^ 0xffffffff),buf,len) ^ 0xffffffff);
> > >
> > > ...otherwise all the CRC checks fail.
> >
> > What bootloader? If ppcboot/uboot I think you will find that
> > ppcboot/uboot has 2 versions of crc32 and you are using the
> > wrong one?
> 
> As I said above, at the moment I'm implementing it as a Linux application and 
> so using the crc32() in userspace zlib which (I am suggesting) is different 
> to the one in the kernel.

OK, then I am lost. 

> 
> Why does ppcboot/uboot have two versions of crc32()? What's the difference 
> between them?

The difference is the ^0xffffffff part you decribed above. One is used by
uboot for crc'ing images, environment etc. The other for JFFS2 support in uboot.

> 
> Phil
> 





More information about the linux-mtd mailing list