From cbf04e364a8c61e4bae650c3584f0d5157c380ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Mon, 11 Mar 2013 11:08:34 +0100 Subject: [PATCH] Eliminated a temporary in the SHA256 round. --- ChangeLog | 2 ++ sha256-compress.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e98ba45c..26d7780c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2013-03-11 Niels Möller <nisse@lysator.liu.se> + * sha256-compress.c (ROUND): Eliminated a temporary. + * armv7/sha1-compress.asm: New file, 9% speedup. * testsuite/testutils.c (test_hash): Test different alignments for diff --git a/sha256-compress.c b/sha256-compress.c index 3f441e81..96a88946 100644 --- a/sha256-compress.c +++ b/sha256-compress.c @@ -89,11 +89,11 @@ /* 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 { \ - uint32_t T = h + S1(e) + Choice(e,f,g) + k + data; \ - d += T; \ - h = T + S0(a) + Majority(a,b,c); \ -} while (0) +#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 _nettle_sha256_compress(uint32_t *state, const uint8_t *input, const uint32_t *k) -- GitLab