From 8149d146d7558e0161175ecdeeefededc31bd776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Mon, 12 Nov 2012 21:01:52 +0100 Subject: [PATCH] Moved ROTL64 macro to macros.h. --- ChangeLog | 3 +++ macros.h | 4 +++- sha512-compress.c | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17b181ac..60523819 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2012-11-12 Niels Möller <nisse@lysator.liu.se> + * macros.h (ROTL64): New macro, moved from... + * sha512-compress.c (ROTL64): ... old location, deleted. + * serpent-internal.h [HAVE_NATIVE_64_BIT] (DROTL32): Renamed from... (ROTL64): ... old name. (DRSHIFT32): Renamed from ... diff --git a/macros.h b/macros.h index b2d4b02e..b2d6076f 100644 --- a/macros.h +++ b/macros.h @@ -119,7 +119,9 @@ do { \ (dst) += (blocksize), \ (src) += (blocksize)) ) -#define ROTL32(n,x) ((((x))<<(n)) | (((x))>>(32-(n)))) +#define ROTL32(n,x) (((x)<<(n)) | ((x)>>(32-(n)))) + +#define ROTL64(n,x) (((x)<<(n)) | ((x)>>(64-(n)))) /* Requires that size >= 2 */ #define INCREMENT(size, ctr) \ diff --git a/sha512-compress.c b/sha512-compress.c index e01fc8a8..901b6cf4 100644 --- a/sha512-compress.c +++ b/sha512-compress.c @@ -38,8 +38,6 @@ /* A block, treated as a sequence of 64-bit words. */ #define SHA512_DATA_LENGTH 16 -#define ROTL64(n,x) ((x)<<(n) | ((x)>>(64-(n)))) - /* The SHA512 functions. The Choice function is the same as the SHA1 function f1, and the majority function is the same as the SHA1 f3 function, and the same as for SHA256. */ -- GitLab