From c6d5b307044ab56688102a9453ad12ba2131a56c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 17 Aug 2016 19:23:04 +0200 Subject: MacOSX: fix compiler warning about ALIGN macro being already defined --- src/Crypto/Streebog.c | 18 +++++++++--------- src/Crypto/Streebog.h | 14 +++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Crypto/Streebog.c b/src/Crypto/Streebog.c index 60adea52..6c52ce75 100644 --- a/src/Crypto/Streebog.c +++ b/src/Crypto/Streebog.c @@ -17,19 +17,19 @@ /* * Iteration constants defined in standard. */ -ALIGN(16) static const unsigned long long buffer0[8] = { 0x0ULL, 0x0ULL, 0x0ULL, +STREEBOG_ALIGN(16) static const unsigned long long buffer0[8] = { 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL }; #ifndef __GOST3411_BIG_ENDIAN__ -ALIGN(16) static const unsigned long long buffer512[8] = {0x0000000000000200ULL, +STREEBOG_ALIGN(16) static const unsigned long long buffer512[8] = {0x0000000000000200ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL }; #else -ALIGN(16) static const unsigned long long buffer512[8] = {{ 0x0002000000000000ULL, +STREEBOG_ALIGN(16) static const unsigned long long buffer512[8] = {{ 0x0002000000000000ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL }}; #endif #ifndef __GOST3411_BIG_ENDIAN__ -ALIGN(16) static const unsigned long long C[12][8] = { +STREEBOG_ALIGN(16) static const unsigned long long C[12][8] = { { 0xdd806559f2a64507ULL, 0x05767436cc744d23ULL, @@ -152,7 +152,7 @@ ALIGN(16) static const unsigned long long C[12][8] = { } }; #else -ALIGN(16) static const unsigned long long C[12][8] = { +STREEBOG_ALIGN(16) static const unsigned long long C[12][8] = { { 0x0745a6f2596580ddULL, 0x234d74cc36747605ULL, @@ -380,7 +380,7 @@ static const unsigned char Pi[256] = { /* * Precalculation of matrix A multiplication. */ -ALIGN(16) static const unsigned long long Ax[8][256] = +STREEBOG_ALIGN(16) static const unsigned long long Ax[8][256] = { { 0xd01f715b5c7ef8e6ULL, 0x16fa240980778325ULL, 0xa8a42e857ee049c8ULL, @@ -1088,7 +1088,7 @@ ALIGN(16) static const unsigned long long Ax[8][256] = } }; #else -ALIGN(16) static const unsigned long long Ax[8][256] = +STREEBOG_ALIGN(16) static const unsigned long long Ax[8][256] = { { 0xe6f87e5c5b711fd0ULL, 0x258377800924fa16ULL, 0xc849e07e852ea4a8ULL, @@ -2287,7 +2287,7 @@ g(unsigned long long *h, const unsigned long long *N, const unsigned char *m) } else #endif { - ALIGN(16) unsigned long long Ki[8], data[8]; + STREEBOG_ALIGN(16) unsigned long long Ki[8], data[8]; unsigned int i; XLPS(h, N, (data)); @@ -2322,7 +2322,7 @@ stage2(STREEBOG_CTX *CTX, const unsigned char *data) static void stage3(STREEBOG_CTX *CTX) { - ALIGN(16) unsigned long long buf[8]; + STREEBOG_ALIGN(16) unsigned long long buf[8]; memset(buf, 0x00, sizeof buf); memcpy(buf, (CTX->buffer), CTX->bufsize); diff --git a/src/Crypto/Streebog.h b/src/Crypto/Streebog.h index 3cb8d8ed..d5691e70 100644 --- a/src/Crypto/Streebog.h +++ b/src/Crypto/Streebog.h @@ -16,15 +16,15 @@ extern "C" { #endif -#define ALIGN(a) CRYPTOPP_ALIGN_DATA(a) +#define STREEBOG_ALIGN(a) CRYPTOPP_ALIGN_DATA(a) -typedef ALIGN(16) struct _STREEBOG_CTX +typedef STREEBOG_ALIGN(16) struct _STREEBOG_CTX { - ALIGN(16) unsigned char buffer[64]; - ALIGN(16) unsigned long long hash[8]; - ALIGN(16) unsigned long long h[8]; - ALIGN(16) unsigned long long N[8]; - ALIGN(16) unsigned long long Sigma[8]; + STREEBOG_ALIGN(16) unsigned char buffer[64]; + STREEBOG_ALIGN(16) unsigned long long hash[8]; + STREEBOG_ALIGN(16) unsigned long long h[8]; + STREEBOG_ALIGN(16) unsigned long long N[8]; + STREEBOG_ALIGN(16) unsigned long long Sigma[8]; size_t bufsize; unsigned int digest_size; } STREEBOG_CTX; -- cgit v1.2.3