Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 23 Dec 2011 19:56:43 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: Re: Bit slice implementation of DES based hashes

On Fri, Dec 23, 2011 at 09:14:19PM +0530, Piyush Mittal wrote:
> > #define init_depth() \
> >     int depth; \
> >     depth = index >> ARCH_BITS_LOG; \
> >     index &= (ARCH_BITS - 1);
> 
> 1.Does depth here means word?

Perhaps, although this depends on what you mean by these words.

> 2.Why we are using init_depth() even it always led to depth=0

It does not always lead to depth=0, it may also lead to other values.

> 3.What is the significance of ARCH_BITS_LOG here?

Like I said before, we're splitting the index into two components.  Some
bits of the original index become the native machine word number and
some bits become the bit number within that word.

Please re-read the following and try to understand it:

"DEPTH is a macro that may expand either to empty string or to
[depth].  The latter is used when we're dealing with SIMD vectors larger
than machine word size - e.g., 128-bit with SSE2, whereas the native
word size is just 64 or 32 bits.  In get_hash*() functions, we need to
extract some bits from just one bit layer.  We do this with regular
(non-SIMD) operations and machine words (in fact, even these are wider
than necessary since we're dealing with just one bit layer in these
functions).  Thus, we split the bit layer index into two components:
native machine word "depth" (which word in a SIMD vector we're dealing
with currently) and bit position in that word."

I don't think I can explain it in a way that would be much easier to
understand, sorry.

Alexander

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ