Commit d20990fd authored by Niels Möller's avatar Niels Möller

Renamed serpent-internal.h macros.

parent 83b7c95b
2012-11-12 Niels Möller <nisse@lysator.liu.se>
* serpent-internal.h [HAVE_NATIVE_64_BIT] (DROTL32): Renamed from...
(ROTL64): ... old name.
(DRSHIFT32): Renamed from ...
(RSHIFT64): ... old name.
* serpent-encrypt.c (LINEAR_TRANSFORMATION64): Updated for above
renames.
* serpent-decrypt.c (LINEAR_TRANSFORMATION64_INVERSE): Likewise.
2012-11-11 Niels Möller <nisse@lysator.liu.se>
From Nikos Mavrogiannopoulos:
......
......@@ -438,16 +438,16 @@
/* In-place inverse linear transformation. */
#define LINEAR_TRANSFORMATION64_INVERSE(x0,x1,x2,x3) \
do { \
x2 = ROTL64 (10, x2); \
x0 = ROTL64 (27, x0); \
x2 = x2 ^ x3 ^ RSHIFT64(7, x1); \
x2 = DROTL32 (10, x2); \
x0 = DROTL32 (27, x0); \
x2 = x2 ^ x3 ^ DRSHIFT32(7, x1); \
x0 = x0 ^ x1 ^ x3; \
x3 = ROTL64 (25, x3); \
x1 = ROTL64 (31, x1); \
x3 = x3 ^ x2 ^ RSHIFT64(3, x0); \
x3 = DROTL32 (25, x3); \
x1 = DROTL32 (31, x1); \
x3 = x3 ^ x2 ^ DRSHIFT32(3, x0); \
x1 = x1 ^ x0 ^ x2; \
x2 = ROTL64 (29, x2); \
x0 = ROTL64 (19, x0); \
x2 = DROTL32 (29, x2); \
x0 = DROTL32 (19, x0); \
} while (0)
#define ROUND64_INVERSE(which, subkey, x0,x1,x2,x3, y0,y1,y2,y3) \
......
......@@ -411,16 +411,16 @@
#define LINEAR_TRANSFORMATION64(x0,x1,x2,x3) \
do { \
x0 = ROTL64 (13, x0); \
x2 = ROTL64 (3, x2); \
x0 = DROTL32 (13, x0); \
x2 = DROTL32 (3, x2); \
x1 = x1 ^ x0 ^ x2; \
x3 = x3 ^ x2 ^ RSHIFT64(3, x0); \
x1 = ROTL64 (1, x1); \
x3 = ROTL64 (7, x3); \
x3 = x3 ^ x2 ^ DRSHIFT32(3, x0); \
x1 = DROTL32 (1, x1); \
x3 = DROTL32 (7, x3); \
x0 = x0 ^ x1 ^ x3; \
x2 = x2 ^ x3 ^ RSHIFT64(7, x1); \
x0 = ROTL64 (5, x0); \
x2 = ROTL64 (22, x2); \
x2 = x2 ^ x3 ^ DRSHIFT32(7, x1); \
x0 = DROTL32 (5, x0); \
x2 = DROTL32 (22, x2); \
} while (0)
#define ROUND64(which, subkey, x0,x1,x2,x3, y0,y1,y2,y3) \
......
......@@ -51,7 +51,7 @@
#if HAVE_NATIVE_64_BIT
/* Operate independently on both halves of a 64-bit word. */
#define ROTL64(n,x) \
#define DROTL32(n,x) \
(((x) << (n) & ~((((uint64_t) 1 << (n))-1) << 32)) \
|(((x) >> (32-(n))) & ~((((uint64_t) 1 << (32-(n)))-1) << (n))))
......@@ -64,7 +64,7 @@
_sk = (subkey)[3]; _sk |= _sk << 32; (x3) ^= _sk; \
} while (0)
#define RSHIFT64(n,x) \
#define DRSHIFT32(n,x) \
( ((x) << (n)) & ~((((uint64_t) 1 << (n)) - 1) << 32))
#endif /* HAVE_NATIVE_64_BIT */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment