diff --git a/ChangeLog b/ChangeLog index 17b181ac9d916ca52b198dfe19135ec7929213a5..605238191ebda8fbdc3523962abac37194478139 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 b2d4b02e605d982f86487e88799b7af3843d8900..b2d6076f5d53d8f43707383a532fd44f57fe3f4a 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 e01fc8a8eacd3e02453f23e57a2511000b571574..901b6cf4c9d7a1c95e3eace1f8d0272247cf2b69 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. */