From: Niels Möller Date: Tue, 21 Jun 2011 18:26:52 +0000 (+0200) Subject: (SBOX6_INVERSE): Eliminated temporaries. X-Git-Tag: nettle_2.2_release_20110711~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7923c7632a109afd924867d7b446eed3b1b672f;p=thirdparty%2Fnettle.git (SBOX6_INVERSE): Eliminated temporaries. Rev: nettle/serpent-decrypt.c:1.9 --- diff --git a/serpent-decrypt.c b/serpent-decrypt.c index 8cc9a6c4..a5f33996 100644 --- a/serpent-decrypt.c +++ b/serpent-decrypt.c @@ -344,28 +344,26 @@ 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 */