]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(SBOX5_INVERSE): Eliminated temporaries.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 21 Jun 2011 10:56:27 +0000 (12:56 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 21 Jun 2011 10:56:27 +0000 (12:56 +0200)
Rev: nettle/serpent-decrypt.c:1.8

serpent-decrypt.c

index 7af429644c0de70220d2bf86d1ae59cbe1f5a852..8cc9a6c44e5cf7916b95dd4f0bc309f5fdf8d1d9 100644 (file)
      y2  = t16 ^ t15;
 */
 #define SBOX5_INVERSE(type, x0, x1, x2, x3, y0, y1, y2, y3) \
-  do { \
-    type t02, t03, t04, t05, t07, t08, t09; \
-    type t10, t12, t13, t15, t16, t01; \
-    t01 = x0  & x3; \
-    t02 = x2  ^ t01; \
-    t03 = x0  ^ x3; \
-    t04 = x1  & t02; \
-    t05 = x0  & x2; \
-    y0  = t03 ^ t04; \
-    t07 = x0  & y0; \
-    t08 = t01 ^ y0; \
-    t09 = x1  | t05; \
-    t10 =     ~ x1; \
-    y1  = t08 ^ t09; \
-    t12 = t10 | t07; \
-    t13 = y0  | y1; \
-    y3  = t02 ^ t12; \
-    t15 = t02 ^ t13; \
-    t16 = x1  ^ x3; \
-    y2  = t16 ^ t15; \
+  do {                                                     \
+    y1  = x0 & x3;                                         \
+    y3  = x2 ^ y1;                                         \
+    y0  = x1 & y3;                                         \
+    y2  = x0 ^ x3;                                         \
+    x3 ^= x1;                                              \
+    y0 ^= y2;                                              \
+    x2 &= x0;                                              \
+    x0 &= y0;                                              \
+    x2 |= x1;                                              \
+    y1 ^= y0;                                              \
+    y1 ^= x2;                                              \
+    y2  = y0 | y1;                                         \
+    y2 ^= y3;                                              \
+    y2 ^= x3;                                              \
+    x1  = ~ x1;                                                    \
+    x1 |= x0;                                              \
+    y3 ^= x1;                                              \
   } while (0)
 
 /* S6 inverse:  15 10  1 13  5  3  6  0  4  9 14  7  2 12  8 11 */