]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Eliminated a temporary in the SHA256 round.
authorNiels Möller <nisse@lysator.liu.se>
Mon, 11 Mar 2013 10:08:34 +0000 (11:08 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 11 Mar 2013 10:08:34 +0000 (11:08 +0100)
ChangeLog
sha256-compress.c

index e98ba45c5371827bb76c6c074792b5d565e9e394..26d7780c13f2d48813bfa3bf2c88db6c696c4cf9 100644 (file)
--- 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
index 3f441e816fdf8d87a913beffb9486563f234c394..96a88946e968b16c08c3dc4af32919c902bf4e7e 100644 (file)
 
 /* 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)