mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 04:34:41 +02:00
refactor ALIGN16 macro to types.h
This commit is contained in:
@@ -46,23 +46,8 @@
|
|||||||
#include <emmintrin.h>
|
#include <emmintrin.h>
|
||||||
#include <smmintrin.h>
|
#include <smmintrin.h>
|
||||||
|
|
||||||
#if !defined (ALIGN16)
|
|
||||||
#if defined (__GNUC__)
|
|
||||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
/* disable align warning, we want alignment ! */
|
|
||||||
#pragma warning(disable: 4324)
|
|
||||||
#define ALIGN16 __declspec (align (16))
|
|
||||||
#else
|
|
||||||
#define ALIGN16
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* WOLFSSL_AESNI */
|
#endif /* WOLFSSL_AESNI */
|
||||||
|
|
||||||
#if !defined (ALIGN16)
|
|
||||||
#define ALIGN16
|
|
||||||
#endif
|
|
||||||
#endif /* HAVE_FIPS */
|
#endif /* HAVE_FIPS */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -54,22 +54,6 @@ enum {
|
|||||||
|
|
||||||
#ifndef WOLFSSL_TI_HASH
|
#ifndef WOLFSSL_TI_HASH
|
||||||
|
|
||||||
#ifdef WOLFSSL_ARMASM /* slight performance increase with aligned memory */
|
|
||||||
#if !defined (ALIGN16)
|
|
||||||
#if defined (__GNUC__)
|
|
||||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
/* disable align warning, we want alignment ! */
|
|
||||||
#pragma warning(disable: 4324)
|
|
||||||
#define ALIGN16 __declspec (align (16))
|
|
||||||
#else
|
|
||||||
#define ALIGN16
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#else /* not using ARM ASM*/
|
|
||||||
#define ALIGN16
|
|
||||||
#endif /* WOLFSSL_ARMASM */
|
|
||||||
|
|
||||||
/* Sha256 digest */
|
/* Sha256 digest */
|
||||||
typedef struct Sha256 {
|
typedef struct Sha256 {
|
||||||
word32 buffLen; /* in bytes */
|
word32 buffLen; /* in bytes */
|
||||||
|
@@ -386,6 +386,26 @@
|
|||||||
#define INVALID_DEVID -2
|
#define INVALID_DEVID -2
|
||||||
|
|
||||||
|
|
||||||
|
/* AESNI requires alignment and ARMASM gains some performance from it */
|
||||||
|
#if defined(WOLFSSL_AESNI) || defined(WOLFSSL_ARMASM)
|
||||||
|
#if !defined (ALIGN16)
|
||||||
|
#if defined (__GNUC__)
|
||||||
|
#define ALIGN16 __attribute__ ( (aligned (16)))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
/* disable align warning, we want alignment ! */
|
||||||
|
#pragma warning(disable: 4324)
|
||||||
|
#define ALIGN16 __declspec (align (16))
|
||||||
|
#else
|
||||||
|
#define ALIGN16
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifndef ALIGN16
|
||||||
|
#define ALIGN16
|
||||||
|
#endif
|
||||||
|
#endif /* WOLFSSL_AESNI or WOLFSSL_ARMASM */
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user