Date: Tue, 26 Apr 2005 22:22:40 +0200 From: Jose M Rodriguez <josemi@freebsd.jazztel.es> To: Marcel Moolenaar <marcel@xcllnt.net> Cc: Jose M Rodriguez <josemi@freebsd.jazztel.es> Subject: Re: rigth crc32 implementation Message-ID: <200504262222.41463.josemi@redesjm.local> In-Reply-To: <20050426194208.GB7773@ns1.xcllnt.net> References: <200504261143.55195.josemi@redesjm.local> <20050426194208.GB7773@ns1.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
El Martes, 26 de Abril de 2005 21:42, Marcel Moolenaar escribi=F3: > On Tue, Apr 26, 2005 at 11:43:54AM +0200, Jose M Rodriguez wrote: > > My first think was use the libkern based one, but I found: > > sys/linkern/crc32.c > > > > - the code may not be endian safe. > > It operates on bytes, so it's endian-safe. Note that the uint32_t > that's returned is not subject to endianness issues: it's always > in the native byte order. The caller of crc32 needs to byteswap > if it needs to compare this integral with a CRC that's not in > the native byte order. > Yes, but this code come from a previous reduction: calculate the table=20 from a xor/shift bit oriented alg. Looking at sys/net/if_ethersubr.c ether_crc32_be() & ether_crc32_le(), I=20 became to doubt if we need two tables, with bitesex based #ifs. =2D- josemi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504262222.41463.josemi>