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

(SBOX1): Renamed arguments. Eliminated temporaries.

Rev: nettle/ChangeLog:1.178
Rev: nettle/serpent-encrypt.c:1.3
parent 66b7bda5
......@@ -2,6 +2,7 @@
* serpent-encrypt.c (SBOX0): Renamed arguments. Eliminated
temporaries.
(SBOX1): Likewise.
2011-06-06 Niels Mller <nisse@lysator.liu.se>
......
......@@ -95,28 +95,26 @@
} while (0)
/* S1: 15 12 2 7 9 0 5 10 1 11 14 8 6 13 3 4 */
#define SBOX1(type, a, b, c, d, w, x, y, z) \
do { \
type t02, t03, t04, t05, t06, t07, t08; \
type t10, t11, t12, t13, t16, t17, t01; \
t01 = a | d ; \
t02 = c ^ d ; \
t03 = ~ b ; \
t04 = a ^ c ; \
t05 = a | t03; \
t06 = d & t04; \
t07 = t01 & t02; \
t08 = b | t06; \
y = t02 ^ t05; \
t10 = t07 ^ t08; \
t11 = t01 ^ t10; \
t12 = y ^ t11; \
t13 = b & d ; \
z = ~ t10; \
x = t13 ^ t12; \
t16 = t10 | x ; \
t17 = t05 & t16; \
w = c ^ t17; \
#define SBOX1(type, x0, x1, x2, x3, y0, y1, y2, y3) \
do { \
y1 = x0 | x3; \
y2 = x2 ^ x3; \
y0 = ~ x1; \
y3 = x0 ^ x2; \
y0 |= x0; \
y3 &= x3; \
x0 = y1 & y2; \
y3 |= x1; \
y2 ^= y0; \
y3 ^= x0; \
x0 = y1 ^ y3; \
x0 ^= y2; \
y1 = x1 & x3; \
y1 ^= x0; \
x3 = y3 | y1; \
y3 = ~ y3; \
y0 &= x3; \
y0 ^= x2; \
} while (0)
/* S2: 8 6 7 9 3 12 10 15 13 1 14 4 0 11 5 2 */
......
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