Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wim Lewis
nettle
Commits
9474fe42
Commit
9474fe42
authored
14 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
(SBOX5): Renamed arguments. Eliminated temporaries.
Rev: nettle/ChangeLog:1.184 Rev: nettle/serpent-encrypt.c:1.9
parent
e7584b8b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+5
-0
5 additions, 0 deletions
ChangeLog
serpent-encrypt.c
+38
-21
38 additions, 21 deletions
serpent-encrypt.c
with
43 additions
and
21 deletions
ChangeLog
+
5
−
0
View file @
9474fe42
2011-06-10 Niels Mller <nisse@lysator.liu.se>
* serpent-encrypt.c (SBOX5): Renamed arguments. Eliminated
temporaries.
2011-06-09 Niels Mller <nisse@lysator.liu.se>
* serpent-encrypt.c (SBOX4): Renamed arguments. Eliminated
...
...
This diff is collapsed.
Click to expand it.
serpent-encrypt.c
+
38
−
21
View file @
9474fe42
...
...
@@ -231,27 +231,44 @@
} while (0)
/* S5: 15 5 2 11 4 10 9 12 0 3 14 8 13 6 7 1 */
#define SBOX5(type, a, b, c, d, w, x, y, z) \
/* Original single-assignment form:
t01 = x1 ^ x3;
t02 = x1 | x3;
t03 = x0 & t01;
t04 = x2 ^ t02;
t05 = t03 ^ t04;
y0 = ~ t05;
t07 = x0 ^ t01;
t08 = x3 | y0;
t09 = x1 | t05;
t10 = x3 ^ t08;
t11 = x1 | t07;
t12 = t03 | y0;
t13 = t07 | t10;
t14 = t01 ^ t11;
y2 = t09 ^ t13;
y1 = t07 ^ t08;
y3 = t12 ^ t14;
*/
#define SBOX5(type, x0, x1, x2, x3, y0, y1, y2, y3) \
do { \
type t02, t03, t04, t05, t07, t08, t09; \
type t10, t11, t12, t13, t14, t01; \
t01 = b ^ d ; \
t02 = b | d ; \
t03 = a & t01; \
t04 = c ^ t02; \
t05 = t03 ^ t04; \
w = ~ t05; \
t07 = a ^ t01; \
t08 = d | w ; \
t09 = b | t05; \
t10 = d ^ t08; \
t11 = b | t07; \
t12 = t03 | w ; \
t13 = t07 | t10; \
t14 = t01 ^ t11; \
y = t09 ^ t13; \
x = t07 ^ t08; \
z = t12 ^ t14; \
y0 = x1 | x3; \
y0 ^= x2; \
x2 = x1 ^ x3; \
y2 = x0 ^ x2; \
x0 &= x2; \
y0 ^= x0; \
y3 = x1 | y2; \
x1 |= y0; \
y0 = ~y0; \
x0 |= y0; \
y3 ^= x2; \
y3 ^= x0; \
y1 = x3 | y0; \
x3 ^= y1; \
y1 ^= y2; \
y2 |= x3; \
y2 ^= x1; \
} while (0)
/* S6: 7 2 12 5 8 4 6 11 14 9 1 15 13 3 10 0 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment