[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140128001552.GA31482@openwall.com>
Date: Tue, 28 Jan 2014 04:15:52 +0400
From: Solar Designer <solar@...nwall.com>
To: discussions@...sword-hashing.net
Subject: Re: [PHC] Combining sliding window and bit-reversal
On Mon, Jan 27, 2014 at 07:00:58PM -0500, Bill Cox wrote:
> The Catena code does it this way:
>
> - swap 4 bytes little-endian to big-endian style - 4 cycles max, or 1
> in parallel.
> - swap each upper nibble with the lower nibble:
> x = ((x & F0F0F0F0) >> 4) | ((x & 0x0F0F0F0F) << 4)
> - swap bit pairs...
>
> you get the idea.
>
> It's just a few cycles. Once per memory block, and it's no problem.
Yeah, I've seen this, and I've seen many of these tricks before. Here's
a reasonably good collection of them:
http://stackoverflow.com/questions/746171/best-algorithm-for-bit-reversal-from-msb-lsb-to-lsb-msb-in-c
Alexander
Powered by blists - more mailing lists