From: Niels Möller Date: Wed, 13 Mar 2013 08:23:58 +0000 (+0100) Subject: Eliminated a temporary in the SHA512 round. X-Git-Tag: nettle_2.7_release_20130424~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5831b559e08475aaf951b7115a86aeee0ef8ee10;p=thirdparty%2Fnettle.git Eliminated a temporary in the SHA512 round. --- diff --git a/ChangeLog b/ChangeLog index 58b9203d..00837d45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2013-03-13 Niels Möller + * sha512-compress.c (ROUND): Eliminated a temporary, analogous to + sha256 change below. + * x86_64/sha256-compress.asm: New file, 16% speedup (benchmarked on intel i5). diff --git a/sha512-compress.c b/sha512-compress.c index 9dd34f4c..0e7d5495 100644 --- a/sha512-compress.c +++ b/sha512-compress.c @@ -85,10 +85,10 @@ /* It's crucial that DATA is only used once, as that argument will * have side effects. */ -#define ROUND(a,b,c,d,e,f,g,h,k,data) do { \ - uint64_t T = h + S1(e) + Choice(e,f,g) + k + data; \ - d += T; \ - h = T + S0(a) + Majority(a,b,c); \ +#define ROUND(a,b,c,d,e,f,g,h,k,data) do { \ + h += S1(e) + Choice(e,f,g) + k + data; \ + d += h; \ + h += S0(a) + Majority(a,b,c); \ } while (0) void