From 12d08fe3a50f28fe80ff591e05d7f8253148afb4 Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Fri, 1 Sep 2023 08:41:11 +0100 Subject: Move ALIGN32 and ALIGN64 into common.h, and fix for clang-cl.exe clang-cl.exe defines __clang__ and _MSC_VER but not __GNUC__, so a clang- specific guard is needed to get the correct ALIGNxx versions. Fixes #21914 Change-Id: Icdc047b182ad1ba61c7b1b06a1e951eda1a0c33d Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/21921) --- crypto/ec/ecp_nistz256.c | 8 -------- crypto/ec/ecp_sm2p256.c | 12 +----------- 2 files changed, 1 insertion(+), 19 deletions(-) (limited to 'crypto/ec') diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c index 44d9054a17..8addb1e40c 100644 --- a/crypto/ec/ecp_nistz256.c +++ b/crypto/ec/ecp_nistz256.c @@ -37,14 +37,6 @@ # define TOBN(hi,lo) ((BN_ULONG)hi<<32|lo) #endif -#if defined(__GNUC__) -# define ALIGN32 __attribute((aligned(32))) -#elif defined(_MSC_VER) -# define ALIGN32 __declspec(align(32)) -#else -# define ALIGN32 -#endif - #define ALIGNPTR(p,N) ((unsigned char *)p+N-(size_t)p%N) #define P256_LIMBS (256/BN_BITS2) diff --git a/crypto/ec/ecp_sm2p256.c b/crypto/ec/ecp_sm2p256.c index 49fab47187..6ec4245529 100644 --- a/crypto/ec/ecp_sm2p256.c +++ b/crypto/ec/ecp_sm2p256.c @@ -18,19 +18,9 @@ #include #include "crypto/bn.h" #include "ec_local.h" +#include "internal/common.h" #include "internal/constant_time.h" -#if defined(__GNUC__) -# define ALIGN32 __attribute((aligned(32))) -# define ALIGN64 __attribute((aligned(64))) -#elif defined(_MSC_VER) -# define ALIGN32 __declspec(align(32)) -# define ALIGN64 __declspec(align(64)) -#else -# define ALIGN32 -# define ALIGN64 -#endif - #define P256_LIMBS (256 / BN_BITS2) #if !defined(OPENSSL_NO_SM2_PRECOMP) -- cgit v1.2.3