Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 21 Mar 2012 09:47:39 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: left shift by 1 via ADD

magnum -

There are some rotates by 1 bit in SHA-1.  When we don't have XOP, those
involve left shifts by 1 bit (as well as right shifts and ORs).  The
left shifts may be replaced by ADDs, which are 1 byte shorter.  (I am
already using this trick in the DES key setup.)  The attached patch
reduces the sse-intrinsics.o .text size by 128 bytes here (relative to
the version with MD5 optimizations).  The reduced code size might result
in a speedup on CPUs with caching of x86 instructions (as opposed to
micro-ops) - on Atom maybe?  On E5420, there's no difference.

Alexander

View attachment "sse-intrinsics.c-sha.diff" of type "text/plain" (890 bytes)

View attachment "sse-intrinsics.c.diff" of type "text/plain" (876 bytes)

Powered by blists - more mailing lists

Your e-mail address:

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