]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(ROUND): Simplified macro.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 24 Oct 2008 19:41:14 +0000 (21:41 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 24 Oct 2008 19:41:14 +0000 (21:41 +0200)
Rev: nettle/sha256.c:1.2

sha256.c

index 6b8cfbc9024891512899a8061c6ddf01904983d8..8355140b70d353a2c7d04fc07ba3160432a610f5 100644 (file)
--- a/sha256.c
+++ b/sha256.c
@@ -117,14 +117,12 @@ K[64] =
    iteration. This code is then replicated 8, using the next 8 values
    from the W[] array each time */
 
-/* FIXME: We can probably reorder this to optimize away at least one
- * of T1 and T2. It's crucial that DATA is only used once, as that
- * argument will have side effects. */
+/* 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 T1 = h + S1(e) + Choice(e,f,g) + k + data;  \
-  uint32_t T2 = S0(a) + Majority(a,b,c);               \
-  d += T1;                                             \
-  h = T1 + T2;                                         \
+  uint32_t T = h + S1(e) + Choice(e,f,g) + k + data;   \
+  d += T;                                              \
+  h = T + S0(a) + Majority(a,b,c);                     \
 } while (0)
 
 /* Initialize the SHA values */