Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 24 Mar 2012 02:05:02 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: Re: SHA-256 and SHA-512 implementations

Hi,

I don't normally top-post, but I find it appropriate this time.
Included below my signature is my posting from two months ago with the
previous status/thoughts on this.

I've just specified this as a task for GSoC 2012:

JtR: SIMD and bitslice implementations of SHA-512, SHA-256, SHA-crypt,
other SHA-2 based JtR formats

The ideas page at http://openwall.info/wiki/ideas gives more detail on
the task.

While doing it, I did another web search - and surprisingly I found a
closely relevant paper that says it was published on February 13, 2012:

http://eprint.iacr.org/2012/067.pdf

Besides a novel idea of how a single SHA-2 digest may be computed with a
SIMD parallelized implementation of the compression function (great, but
not needed for JtR in particular), this paper gives actual pieces of
code with SSSE3 and AVX2 intrinsics (separately).  No license, though.
I might e-mail the authors.

Alexander

On Mon, Jan 16, 2012 at 11:57:02PM +0400, Solar Designer wrote:
> On Sun, Jan 15, 2012 at 07:03:14PM +0400, Solar Designer wrote:
> > OpenSSL appears to make some use of MMX/SSE2 instructions for SHA-512
> > when running in 32-bit mode, but it only runs one instance of SHA-512 at
> > a time, so it does not use SIMD for real:
> > 
> > http://cvs.openssl.org/dir?d=openssl/crypto/sha/asm
> 
> Crypto++ appears to have similar code to OpenSSL's:
> 
> http://www.cryptopp.com
> 
> also computing just one instance of the hash, yet making use of SSE2.
> I think they do it to access 64-bit integer operations (needed for
> SHA-512) from 32-bit mode.  As to why SSE2 and not just MMX, I think
> that's because MMX lacks 64-bit addition (it can only do two 32-bit
> additions in parallel, but not one 64-bit).
> 
> A difference from OpenSSL is that Crypto++'s individual pieces of code
> (as opposed to the library as a whole) are in the public domain - so we
> may start hacking from their SHA-2 code if we like to.
> 
> Since we need a true SIMD implementation, starting from scratch might
> be a better way to go, though.
> 
> Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.