summaryrefslogtreecommitdiff
path: root/serpent-decrypt.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2011-06-21 23:08:18 +0200
committerNiels Möller <nisse@lysator.liu.se>2011-06-21 23:08:18 +0200
commita1da2a5541af390b4e4284a8d6b8f3fb3f2c2028 (patch)
tree26a66a361310954c39ea6cdbde79f48b168b9b37 /serpent-decrypt.c
parentd912689e1c177ef0026cbbf4b28ffa1eb444ab2a (diff)
downloadnettle-a1da2a5541af390b4e4284a8d6b8f3fb3f2c2028.tar.gz
(SBOX7_INVERSE): Eliminated temporaries.
Rev: nettle/serpent-decrypt.c:1.10
Diffstat (limited to 'serpent-decrypt.c')
-rw-r--r--serpent-decrypt.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/serpent-decrypt.c b/serpent-decrypt.c
index a5f33996..d7f761f8 100644
--- a/serpent-decrypt.c
+++ b/serpent-decrypt.c
@@ -388,27 +388,25 @@
y2 = t14 ^ t16;
*/
#define SBOX7_INVERSE(type, x0, x1, x2, x3, y0, y1, y2, y3) \
- do { \
- type t02, t03, t04, t06, t07, t08, t09; \
- type t10, t11, t13, t14, t15, t16, t01; \
- t01 = x0 & x1; \
- t02 = x0 | x1; \
- t03 = x2 | t01; \
- t04 = x3 & t02; \
- y3 = t03 ^ t04; \
- t06 = x1 ^ t04; \
- t07 = x3 ^ y3; \
- t08 = ~ t07; \
- t09 = t06 | t08; \
- t10 = x1 ^ x3; \
- t11 = x0 | x3; \
- y1 = x0 ^ t09; \
- t13 = x2 ^ t06; \
- t14 = x2 & t11; \
- t15 = x3 | y1; \
- t16 = t01 | t10; \
- y0 = t13 ^ t15; \
- y2 = t14 ^ t16; \
+ do { \
+ y3 = x0 & x1; \
+ y2 = x1 ^ x3; \
+ y2 |= y3; \
+ y1 = x0 | x3; \
+ y1 &= x2; \
+ y2 ^= y1; \
+ y3 |= x2; \
+ y0 = x0 | x1; \
+ y0 &= x3; \
+ y3 ^= y0; \
+ y0 ^= x1; \
+ y1 = x3 ^ y3; \
+ y1 = ~ y1; \
+ y1 |= y0; \
+ y0 ^= x2; \
+ y1 ^= x0; \
+ x3 |= y1; \
+ y0 ^= x3; \
} while (0)
/* In-place inverse linear transformation. */