]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(SBOX6_INVERSE): Eliminated temporaries.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 21 Jun 2011 18:26:52 +0000 (20:26 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 21 Jun 2011 18:26:52 +0000 (20:26 +0200)
Rev: nettle/serpent-decrypt.c:1.9

serpent-decrypt.c

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