Skip to content
Snippets Groups Projects
Commit d778b2da authored by Niels Möller's avatar Niels Möller
Browse files

(SBOX3): Renamed arguments. Eliminated temporaries.

Rev: nettle/ChangeLog:1.180
Rev: nettle/serpent-encrypt.c:1.5
parent 2c32cfc7
Branches
Tags
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
temporaries. temporaries.
(SBOX1): Likewise. (SBOX1): Likewise.
(SBOX2): Likewise. (SBOX2): Likewise.
(SBOX3): Likewise.
2011-06-06 Niels Mller <nisse@lysator.liu.se> 2011-06-06 Niels Mller <nisse@lysator.liu.se>
......
...@@ -141,28 +141,26 @@ ...@@ -141,28 +141,26 @@
} while (0) } while (0)
/* S3: 0 15 11 8 12 9 6 3 13 1 2 4 10 7 5 14 */ /* S3: 0 15 11 8 12 9 6 3 13 1 2 4 10 7 5 14 */
#define SBOX3(type, a, b, c, d, w, x, y, z) \ #define SBOX3(type, x0, x1, x2, x3, y0, y1, y2, y3) \
do { \ do { \
type t02, t03, t04, t05, t06, t07, t08; \ y2 = x0 ^ x2; \
type t09, t10, t11, t13, t14, t15, t01; \ y0 = x0 | x3; \
t01 = a ^ c ; \ y3 = x0 & x3; \
t02 = a | d ; \ y1 = y2 & y0; \
t03 = a & d ; \ y3 |= x1; \
t04 = t01 & t02; \ y2 = x0 & x1; \
t05 = b | t03; \ y2 |= x2; \
t06 = a & b ; \ x2 = x3 ^ y1; \
t07 = d ^ t04; \ y1 ^= y3; \
t08 = c | t06; \ x0 |= x2; \
t09 = b ^ t07; \ x2 ^= x1; \
t10 = d & t05; \ y3 &= x3; \
t11 = t02 ^ t10; \ y0 ^= y3; \
z = t08 ^ t09; \ y3 = y2 ^ x2; \
t13 = d | z ; \ y2 ^= y0; \
t14 = a | t07; \ x3 |= y3; \
t15 = b & t13; \ x1 &= x3; \
y = t08 ^ t11; \ y0 = x0 ^ x1; \
w = t14 ^ t15; \
x = t05 ^ t04; \
} while (0) } while (0)
/* S4: 1 15 8 3 12 0 11 6 2 5 4 10 9 14 7 13 */ /* S4: 1 15 8 3 12 0 11 6 2 5 4 10 9 14 7 13 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment