2011-06-09 Niels Möller <nisse@lysator.liu.se>
+ * serpent-encrypt.c (SBOX4): Renamed arguments. Eliminated
+ temporaries.
+
* configure.ac (LIBNETTLE_LINK, LIBHOGWEED_LINK): Cygwin fix, from
Vincent Torri.
2011-06-08 Niels Möller <nisse@lysator.liu.se>
- * serpent-encrypt.c (SBOX4): Renamed arguments.
-
* examples/eratosthenes.c (find_first_one): Fixed c99-style
declaration. Reported by Sebastian Reitenbach.
(find_first_one): Declare the lookup table as static const, and
y1 = t15 ^ t16;
y0 = ~ t14;
*/
-#define SBOX4(type, x0, x1, x2, x3, y0, y1, y2, y3) \
- do { \
- type t02, t03, t04, t05, t06, t08, t09; \
- type t10, t11, t12, t13, t14, t15, t16, t01; \
- t01 = x0 | x1; \
- t02 = x1 | x2; \
- t03 = x0 ^ t02; \
- t04 = x1 ^ x3; \
- t05 = x3 | t03; \
- t06 = x3 & t01; \
- y3 = t03 ^ t06; \
- t08 = y3 & t04; \
- t09 = t04 & t05; \
- t10 = x2 ^ t06; \
- t11 = x1 & x2; \
- t12 = t04 ^ t08; \
- t13 = t11 | t03; \
- t14 = t10 ^ t09; \
- t15 = x0 & t05; \
- t16 = t11 | t12; \
- y2 = t13 ^ t08; \
- y1 = t15 ^ t16; \
- y0 = ~ t14; \
+#define SBOX4(type, x0, x1, x2, x3, y0, y1, y2, y3) \
+ do { \
+ y3 = x0 | x1; \
+ y2 = x1 | x2; \
+ y2 = x0 ^ y2; \
+ y3 &= x3; \
+ y0 = x1 ^ x3; \
+ x3 |= y2; \
+ x0 &= x3; \
+ x1 &= x2; \
+ x2 ^= y3; \
+ y3 ^= y2; \
+ y2 |= x1; \
+ y1 = y3 & y0; \
+ y2 ^= y1; \
+ y1 ^= y0; \
+ y1 |= x1; \
+ y1 ^= x0; \
+ y0 &= x3; \
+ y0 ^= x2; \
+ y0 = ~y0; \
} while (0)
/* S5: 15 5 2 11 4 10 9 12 0 3 14 8 13 6 7 1 */