Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marcus Hoffmann
nettle
Commits
2b39cfeb
Commit
2b39cfeb
authored
Jun 09, 2011
by
Niels Möller
Browse files
Whitespace and comment changes.
Rev: nettle/serpent-encrypt.c:1.7
parent
d8ec143d
Changes
1
Hide whitespace changes
Inline
Side-by-side
serpent-encrypt.c
View file @
2b39cfeb
...
...
@@ -141,6 +141,27 @@
} while (0)
/* S3: 0 15 11 8 12 9 6 3 13 1 2 4 10 7 5 14 */
/* Original single-assignment form:
t01 = x0 ^ x2;
t02 = x0 | x3;
t03 = x0 & x3;
t04 = t01 & t02;
t05 = x1 | t03;
t06 = x0 & x1;
t07 = x3 ^ t04;
t08 = x2 | t06;
t09 = x1 ^ t07;
t10 = x3 & t05;
t11 = t02 ^ t10;
y3 = t08 ^ t09;
t13 = x3 | y3;
t14 = x0 | t07;
t15 = x1 & t13;
y2 = t08 ^ t11;
y0 = t14 ^ t15;
y1 = t05 ^ t04;
*/
#define SBOX3(type, x0, x1, x2, x3, y0, y1, y2, y3) \
do { \
y2 = x0 ^ x2; \
...
...
@@ -163,30 +184,52 @@
y0 = x0 ^ x1; \
} while (0)
/* S4: 1 15 8 3 12 0 11 6 2 5 4 10 9 14 7 13 */
/* Original single-assignment form:
t01 = x0 | x1;
t02 = x1 | x2;
t03 = x0 ^ t02;
t04 = x1 ^ x3;
t05 = x3 | t03;
t06 = x3 & t01;
y3 = t03 ^ t06;
t08 = y3 & t04;
t09 = t04 & t05;
t10 = x2 ^ t06;
t11 = x1 & x2;
t12 = t04 ^ t08;
t13 = t11 | t03;
t14 = t10 ^ t09;
t15 = x0 & t05;
t16 = t11 | t12;
y2 = t13 ^ t08;
y1 = t15 ^ t16;
y0 = ~ t14;
*/
#define SBOX4(type, x0, x1, x2, x3, y0, y1, y2, y3) \
do { \
type t02, t03, t04, t05, t06, t08, t09; \
type t10, t11, t12, t13, t14, t15, t16, t01; \
t01 = x0
| x1
; \
t02 = x1
| x2
; \
t03 = x0
^ t02; \
t04 = x1
^ x3
; \
t05 = x3
| t03; \
t06 = x3
& t01; \
y3
= t03 ^ t06; \
t08 = y3
& t04; \
t01 = x0 | x1; \
t02 = x1 | x2; \
t03 = x0 ^ t02; \
t04 = x1 ^ x3; \
t05 = x3 | t03; \
t06 = x3 & t01; \
y3 = t03 ^ t06; \
t08 = y3 & t04; \
t09 = t04 & t05; \
t10 = x2
^ t06; \
t11 = x1
& x2
; \
t10 = x2 ^ t06; \
t11 = x1 & x2; \
t12 = t04 ^ t08; \
t13 = t11 | t03; \
t14 = t10 ^ t09; \
t15 = x0
& t05; \
t15 = x0 & t05; \
t16 = t11 | t12; \
y2
= t13 ^ t08; \
y1
= t15 ^ t16; \
y0
= ~ t14; \
y2 = t13 ^ t08; \
y1 = t15 ^ t16; \
y0 = ~ t14; \
} while (0)
/* S5: 15 5 2 11 4 10 9 12 0 3 14 8 13 6 7 1 */
...
...
Write
Preview
Markdown
is supported
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