From db9455be0450dc787eadd1664a48e31336bf8557 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sun, 27 Nov 2022 17:02:49 +0100 Subject: [PATCH] Avoid macro name collision in sha384/sha512 includes --- OpenCL/inc_hash_sha384.h | 10 +++++----- OpenCL/inc_hash_sha512.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/OpenCL/inc_hash_sha384.h b/OpenCL/inc_hash_sha384.h index 882421756..d285eb9aa 100644 --- a/OpenCL/inc_hash_sha384.h +++ b/OpenCL/inc_hash_sha384.h @@ -6,17 +6,17 @@ #ifndef _INC_HASH_SHA384_H #define _INC_HASH_SHA384_H -#define SHIFT_RIGHT_64(x,n) ((x) >> (n)) +#define SHA384_SHR_64(x,n) ((x) >> (n)) #define SHA384_S0_S(x) (hc_rotr64_S ((x), 28) ^ hc_rotr64_S ((x), 34) ^ hc_rotr64_S ((x), 39)) #define SHA384_S1_S(x) (hc_rotr64_S ((x), 14) ^ hc_rotr64_S ((x), 18) ^ hc_rotr64_S ((x), 41)) -#define SHA384_S2_S(x) (hc_rotr64_S ((x), 1) ^ hc_rotr64_S ((x), 8) ^ SHIFT_RIGHT_64 ((x), 7)) -#define SHA384_S3_S(x) (hc_rotr64_S ((x), 19) ^ hc_rotr64_S ((x), 61) ^ SHIFT_RIGHT_64 ((x), 6)) +#define SHA384_S2_S(x) (hc_rotr64_S ((x), 1) ^ hc_rotr64_S ((x), 8) ^ SHA384_SHR_64 ((x), 7)) +#define SHA384_S3_S(x) (hc_rotr64_S ((x), 19) ^ hc_rotr64_S ((x), 61) ^ SHA384_SHR_64 ((x), 6)) #define SHA384_S0(x) (hc_rotr64 ((x), 28) ^ hc_rotr64 ((x), 34) ^ hc_rotr64 ((x), 39)) #define SHA384_S1(x) (hc_rotr64 ((x), 14) ^ hc_rotr64 ((x), 18) ^ hc_rotr64 ((x), 41)) -#define SHA384_S2(x) (hc_rotr64 ((x), 1) ^ hc_rotr64 ((x), 8) ^ SHIFT_RIGHT_64 ((x), 7)) -#define SHA384_S3(x) (hc_rotr64 ((x), 19) ^ hc_rotr64 ((x), 61) ^ SHIFT_RIGHT_64 ((x), 6)) +#define SHA384_S2(x) (hc_rotr64 ((x), 1) ^ hc_rotr64 ((x), 8) ^ SHA384_SHR_64 ((x), 7)) +#define SHA384_S3(x) (hc_rotr64 ((x), 19) ^ hc_rotr64 ((x), 61) ^ SHA384_SHR_64 ((x), 6)) #define SHA384_F0(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) #define SHA384_F1(x,y,z) (((x) & (y)) | ((z) & ((x) ^ (y)))) diff --git a/OpenCL/inc_hash_sha512.h b/OpenCL/inc_hash_sha512.h index af2b1bf8b..e920cc444 100644 --- a/OpenCL/inc_hash_sha512.h +++ b/OpenCL/inc_hash_sha512.h @@ -6,17 +6,17 @@ #ifndef _INC_HASH_SHA512_H #define _INC_HASH_SHA512_H -#define SHIFT_RIGHT_64(x,n) ((x) >> (n)) +#define SHA512_SHR_64(x,n) ((x) >> (n)) #define SHA512_S0_S(x) (hc_rotr64_S ((x), 28) ^ hc_rotr64_S ((x), 34) ^ hc_rotr64_S ((x), 39)) #define SHA512_S1_S(x) (hc_rotr64_S ((x), 14) ^ hc_rotr64_S ((x), 18) ^ hc_rotr64_S ((x), 41)) -#define SHA512_S2_S(x) (hc_rotr64_S ((x), 1) ^ hc_rotr64_S ((x), 8) ^ SHIFT_RIGHT_64 ((x), 7)) -#define SHA512_S3_S(x) (hc_rotr64_S ((x), 19) ^ hc_rotr64_S ((x), 61) ^ SHIFT_RIGHT_64 ((x), 6)) +#define SHA512_S2_S(x) (hc_rotr64_S ((x), 1) ^ hc_rotr64_S ((x), 8) ^ SHA512_SHR_64 ((x), 7)) +#define SHA512_S3_S(x) (hc_rotr64_S ((x), 19) ^ hc_rotr64_S ((x), 61) ^ SHA512_SHR_64 ((x), 6)) #define SHA512_S0(x) (hc_rotr64 ((x), 28) ^ hc_rotr64 ((x), 34) ^ hc_rotr64 ((x), 39)) #define SHA512_S1(x) (hc_rotr64 ((x), 14) ^ hc_rotr64 ((x), 18) ^ hc_rotr64 ((x), 41)) -#define SHA512_S2(x) (hc_rotr64 ((x), 1) ^ hc_rotr64 ((x), 8) ^ SHIFT_RIGHT_64 ((x), 7)) -#define SHA512_S3(x) (hc_rotr64 ((x), 19) ^ hc_rotr64 ((x), 61) ^ SHIFT_RIGHT_64 ((x), 6)) +#define SHA512_S2(x) (hc_rotr64 ((x), 1) ^ hc_rotr64 ((x), 8) ^ SHA512_SHR_64 ((x), 7)) +#define SHA512_S3(x) (hc_rotr64 ((x), 19) ^ hc_rotr64 ((x), 61) ^ SHA512_SHR_64 ((x), 6)) #define SHA512_F0(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) #define SHA512_F1(x,y,z) (((x) & (y)) | ((z) & ((x) ^ (y))))