lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 21 Jun 2009 12:18:25 +0200
From:	Ivo van Doorn <ivdoorn@...il.com>
To:	"Dmitry Eremin-Solenikov" <dbaryshkov@...il.com>
Cc:	Ben Hutchings <ben@...adent.org.uk>, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
	davem@...emloft.net, Stephen Rothwell <sfr@...b.auug.org.au>,
	Sergey Lapin <slapin@...fans.org>,
	Darren Salt <linux@...mustbejoking.demon.co.uk>
Subject: Re: [PATCH 1/6] crc-itu-t: add bit-reversed calculation

[non-HTML reply, sorry about that]

On Sunday 21 June 2009, Dmitry Eremin-Solenikov wrote:
> Hi,
> 
> 
> On Wed, Jun 03, 2009 at 01:43:24PM +0100, Ben Hutchings wrote:
> > On Wed, 2009-06-03 at 13:33 +0400, Dmitry Eremin-Solenikov wrote:
> > [...] 
> > > +/**
> > > + * crc_itu_t_bitreversed - Compute the CRC-ITU-T for the data buffer;
> > > + * the buffer content is assumed to be bit-reversed
> > [...]
> > 
> > This short description spills onto two lines which is invalid and breaks
> > the generation of docs.  Sorry to point this out after recommending the
> > patch to you.
> > 
> > I've changed the description to "crc_itu_t_bitreversed - Compute the
> > CRC-ITU-T for a bit-reversed data buffer" all on one line.
> 
> Just another not w.r.t. this patch: one should add 'select BITREVERSE'
> to this Kconfig entry, as it depends on bitreversing stuff.

What also might be interesting,  have you checked the crc-ccitt algorithm?
I had come across a crc_itu_t with bitreverse implementation in the past as
well, and I could simplify the implementation by using crc-ccit and only call
bitreverse on the last output. So something like:

u16 crc = crc_ccitt(~0, data, len);
u16 crc_itu_t = swab16(crc);

Instead of bitreverse for every step, only a single  byteswap was needed.
You need to check if this indeed works for your driver, but this would
reduce the number of times bitrev is called, and also prevents the BITREV
dependency for the crc implementation.

Ivo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ