Commit 61c1cfc3 authored by Niels Möller's avatar Niels Möller
Browse files

Minor sbox fixes.

Rev: nettle/serpent-encrypt.c:1.11
parent edb1b1a4
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
y1 = x0 | x3; \ y1 = x0 | x3; \
y2 = x2 ^ x3; \ y2 = x2 ^ x3; \
y0 = ~ x1; \ y0 = ~ x1; \
y3 = x0 ^ x2; \ y3 = x0 ^ x2; \
y0 |= x0; \ y0 |= x0; \
y3 &= x3; \ y3 &= x3; \
x0 = y1 & y2; \ x0 = y1 & y2; \
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
y3 ^= x0; \ y3 ^= x0; \
x0 = y1 ^ y3; \ x0 = y1 ^ y3; \
x0 ^= y2; \ x0 ^= y2; \
y1 = x1 & x3; \ y1 = x1 & x3; \
y1 ^= x0; \ y1 ^= x0; \
x3 = y3 | y1; \ x3 = y3 | y1; \
y3 = ~ y3; \ y3 = ~ y3; \
...@@ -164,14 +164,14 @@ ...@@ -164,14 +164,14 @@
*/ */
#define SBOX3(x0, x1, x2, x3, y0, y1, y2, y3) \ #define SBOX3(x0, x1, x2, x3, y0, y1, y2, y3) \
do { \ do { \
y2 = x0 ^ x2; \ y1 = x0 ^ x2; \
y0 = x0 | x3; \ y0 = x0 | x3; \
y3 = x0 & x3; \ y3 = x0 & x3; \
y1 = y2 & y0; \ y1 &= y0; \
y3 |= x1; \ y3 |= x1; \
y2 = x0 & x1; \ y2 = x0 & x1; \
y2 |= x2; \ y2 |= x2; \
x2 = x3 ^ y1; \ x2 = x3 ^ y1; \
y1 ^= y3; \ y1 ^= y3; \
x0 |= x2; \ x0 |= x2; \
x2 ^= x1; \ x2 ^= x1; \
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
do { \ do { \
y3 = x0 | x1; \ y3 = x0 | x1; \
y2 = x1 | x2; \ y2 = x1 | x2; \
y2 = x0 ^ y2; \ y2 ^= x0; \
y3 &= x3; \ y3 &= x3; \
y0 = x1 ^ x3; \ y0 = x1 ^ x3; \
x3 |= y2; \ x3 |= y2; \
......
Supports Markdown
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