lkml.org 
[lkml]   [2022]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 3/7] lib: add rocksoft model crc64
On Mon, Jan 24, 2022 at 09:10:38PM -0800, Eric Biggers wrote:
> On Mon, Jan 24, 2022 at 08:01:03AM -0800, Keith Busch wrote:
> > Since this model reflects inputs and outputs, a helper table and
> > function are added to reverse bits of 8 and 64 bit values.
>
> That's a silly way to do a bit-reflected CRC. The proper way to do it is to
> reflect the bytes too, so that the bits and bytes are ordered consistently, so
> explicitly reflecting the bits isn't needed. Most CRC-32's are bit-reflected,
> and they are usually implemented this way. E.g., see crc32_le() in lib/crc32.c.
>
> Here's a Python script that shows that the Rocksoft CRC-64 can be computed
> without explicitly reversing the bits. It passes the tests from your patch 4:

Thanks for the tip! I'll use that for the next version.

\
 
 \ /
  Last update: 2022-09-17 16:14    [W:0.790 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site