Commit d778b2da authored by Niels Möller's avatar Niels Möller

(SBOX3): Renamed arguments. Eliminated temporaries.

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