Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Brian Smith
nettle
Commits
3bf5be53
Commit
3bf5be53
authored
Jun 21, 2011
by
Niels Möller
Browse files
(SBOX5_INVERSE): Eliminated temporaries.
Rev: nettle/serpent-decrypt.c:1.8
parent
9e9b0478
Changes
1
Hide whitespace changes
Inline
Side-by-side
serpent-decrypt.c
View file @
3bf5be53
...
...
@@ -301,26 +301,24 @@
y2 = t16 ^ t15;
*/
#define SBOX5_INVERSE(type, x0, x1, x2, x3, y0, y1, y2, y3) \
do { \
type t02, t03, t04, t05, t07, t08, t09; \
type t10, t12, t13, t15, t16, t01; \
t01 = x0 & x3; \
t02 = x2 ^ t01; \
t03 = x0 ^ x3; \
t04 = x1 & t02; \
t05 = x0 & x2; \
y0 = t03 ^ t04; \
t07 = x0 & y0; \
t08 = t01 ^ y0; \
t09 = x1 | t05; \
t10 = ~ x1; \
y1 = t08 ^ t09; \
t12 = t10 | t07; \
t13 = y0 | y1; \
y3 = t02 ^ t12; \
t15 = t02 ^ t13; \
t16 = x1 ^ x3; \
y2 = t16 ^ t15; \
do { \
y1 = x0 & x3; \
y3 = x2 ^ y1; \
y0 = x1 & y3; \
y2 = x0 ^ x3; \
x3 ^= x1; \
y0 ^= y2; \
x2 &= x0; \
x0 &= y0; \
x2 |= x1; \
y1 ^= y0; \
y1 ^= x2; \
y2 = y0 | y1; \
y2 ^= y3; \
y2 ^= x3; \
x1 = ~ x1; \
x1 |= x0; \
y3 ^= x1; \
} while (0)
/* S6 inverse: 15 10 1 13 5 3 6 0 4 9 14 7 2 12 8 11 */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment