summaryrefslogtreecommitdiff
path: root/serpent-encrypt.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2012-03-31 21:43:55 +0200
committerNiels Möller <nisse@lysator.liu.se>2012-03-31 21:43:55 +0200
commit8a56233b1ad911c1bdd1959cc2deb9c4f8afcbf1 (patch)
tree217d9bfd667ec5e505f84783524a95cdcf28e799 /serpent-encrypt.c
parente4a28f551c96a7fe731fd47b5544169a19594462 (diff)
downloadnettle-8a56233b1ad911c1bdd1959cc2deb9c4f8afcbf1.tar.gz
Use ROTL32 in the serpent code.
Diffstat (limited to 'serpent-encrypt.c')
-rw-r--r--serpent-encrypt.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/serpent-encrypt.c b/serpent-encrypt.c
index 21651e84..6a022a4f 100644
--- a/serpent-encrypt.c
+++ b/serpent-encrypt.c
@@ -386,16 +386,16 @@
/* In-place linear transformation. */
#define LINEAR_TRANSFORMATION(x0,x1,x2,x3) \
do { \
- x0 = ROL32 (x0, 13); \
- x2 = ROL32 (x2, 3); \
+ x0 = ROTL32 (13, x0); \
+ x2 = ROTL32 (3, x2); \
x1 = x1 ^ x0 ^ x2; \
x3 = x3 ^ x2 ^ (x0 << 3); \
- x1 = ROL32 (x1, 1); \
- x3 = ROL32 (x3, 7); \
+ x1 = ROTL32 (1, x1); \
+ x3 = ROTL32 (7, x3); \
x0 = x0 ^ x1 ^ x3; \
x2 = x2 ^ x3 ^ (x1 << 7); \
- x0 = ROL32 (x0, 5); \
- x2 = ROL32 (x2, 22); \
+ x0 = ROTL32 (5, x0); \
+ x2 = ROTL32 (22, x2); \
} while (0)
/* Round inputs are x0,x1,x2,x3 (destroyed), and round outputs are
@@ -411,16 +411,16 @@
#define LINEAR_TRANSFORMATION64(x0,x1,x2,x3) \
do { \
- x0 = ROL64 (x0, 13); \
- x2 = ROL64 (x2, 3); \
+ x0 = ROTL64 (13, x0); \
+ x2 = ROTL64 (3, x2); \
x1 = x1 ^ x0 ^ x2; \
- x3 = x3 ^ x2 ^ RSHIFT64(x0, 3); \
- x1 = ROL64 (x1, 1); \
- x3 = ROL64 (x3, 7); \
+ x3 = x3 ^ x2 ^ RSHIFT64(3, x0); \
+ x1 = ROTL64 (1, x1); \
+ x3 = ROTL64 (7, x3); \
x0 = x0 ^ x1 ^ x3; \
- x2 = x2 ^ x3 ^ RSHIFT64(x1, 7); \
- x0 = ROL64 (x0, 5); \
- x2 = ROL64 (x2, 22); \
+ x2 = x2 ^ x3 ^ RSHIFT64(7, x1); \
+ x0 = ROTL64 (5, x0); \
+ x2 = ROTL64 (22, x2); \
} while (0)
#define ROUND64(which, subkey, x0,x1,x2,x3, y0,y1,y2,y3) \