Re: [PATCH 0/3] Add optimized SHA-1 implementations for x86 and x86_64

2007-06-11 Thread Adrian Bunk
On Fri, Jun 08, 2007 at 05:42:42PM -0400, Benjamin Gilbert wrote: > The following 3-part series adds assembly implementations of the SHA-1 > transform for x86 and x86_64. For x86_64 the optimized code is always > selected; on x86 it is selected if the kernel is compiled for i486 or above > (since

[PATCH] [CRYPTO] Add optimized SHA-1 implementation for x86_64

2007-06-11 Thread Benjamin Gilbert
Add optimized implementation of the SHA-1 hash function for x86_64, ported from the x86 implementation in Nettle (which is LGPLed). The code has been tested with tcrypt and the NIST test vectors. Signed-off-by: Benjamin Gilbert <[EMAIL PROTECTED]> --- arch/x86_64/kernel/x8664_ksyms.c |3 a

[PATCH] [CRYPTO] Add optimized SHA-1 implementation for i486+

2007-06-11 Thread Benjamin Gilbert
Add x86-optimized implementation of the SHA-1 hash function, taken from Nettle under the LGPL. This code will be enabled on kernels compiled for 486es or better; kernels which support 386es will use the generic implementation (since we need BSWAP). We disable building lib/sha1.o when an optimized

Re: [PATCH 2/3] [CRYPTO] Add optimized SHA-1 implementation for i486+

2007-06-11 Thread Benjamin Gilbert
Benjamin Gilbert wrote: Jan Engelhardt wrote: UTF-8 please. Hint: it should most likely be an รถ. Whoops, I had thought I had gotten that right. I'll get updates for parts 2 and 3 sent out on Monday. I'm sending the corrected parts 2 and 3 as replies to this email. The UTF-8 fix is the *o

Re: [PATCH 3/3] [CRYPTO] Add optimized SHA-1 implementation for x86_64

2007-06-11 Thread Benjamin Gilbert
Andi Kleen wrote: Benjamin Gilbert <[EMAIL PROTECTED]> writes: +#define EXPAND(i) \ + movlOFFSET(i % 16)(DATA), TMP; \ + xorlOFFSET((i + 2) % 16)(DATA), TMP;\ Such overlapping memory accesses

Re: [PATCH 2/3] [CRYPTO] Add optimized SHA-1 implementation for i486+

2007-06-11 Thread Benjamin Gilbert
Matt Mackall wrote: In 2003, I was getting 17MB/s out of my Athlon. Now I'm getting 2.7MB/s. Were your tests with or without the latest /dev/urandom fixes? This one in particular: http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.21.y.git;a=commitdiff;h=374f167dfb97c1785515a0c41e32a66b4

Re: [PATCH 2/3] [CRYPTO] Add optimized SHA-1 implementation for i486+

2007-06-11 Thread Andi Kleen
Matt Mackall <[EMAIL PROTECTED]> writes: > > Have you benchmarked this against lib/sha1.c? Please post the results. > Until then, I'm frankly skeptical that your unrolled version is faster > because when I introduced lib/sha1.c the rolled version therein won by > a significant margin and had 1/10t

Re: [PATCH 3/3] [CRYPTO] Add optimized SHA-1 implementation for x86_64

2007-06-11 Thread Andi Kleen
Benjamin Gilbert <[EMAIL PROTECTED]> writes: > +/* push/pop wrappers that update the DWARF unwind table */ > +#define PUSH(regname)\ > + push%regname; \ > + CFI_ADJUST_CFA_OFFSET 8;