Declare __m128 arrays used as parameters as pointers

Required for MSVC
This commit is contained in:
Frank Denis 2015-10-10 21:07:07 +02:00
parent 78002f8ca7
commit 9055a140f3

View File

@ -42,7 +42,7 @@ typedef struct context {
} context; } context;
static inline void static inline void
aesni_key256_expand(const unsigned char *key, __m128 rkeys[16]) aesni_key256_expand(const unsigned char *key, __m128 *rkeys)
{ {
__m128 key0 = _mm_loadu_ps((const float *) (key + 0)); __m128 key0 = _mm_loadu_ps((const float *) (key + 0));
__m128 key1 = _mm_loadu_ps((const float *) (key + 16)); __m128 key1 = _mm_loadu_ps((const float *) (key + 16));
@ -108,7 +108,7 @@ aesni_key256_expand(const unsigned char *key, __m128 rkeys[16])
/** single, by-the-book AES encryption with AES-NI */ /** single, by-the-book AES encryption with AES-NI */
static inline void static inline void
aesni_encrypt1(unsigned char *out, __m128i nv, const __m128i rkeys[16]) aesni_encrypt1(unsigned char *out, __m128i nv, const __m128i *rkeys)
{ {
__m128i temp = _mm_xor_si128(nv, rkeys[0]); __m128i temp = _mm_xor_si128(nv, rkeys[0]);
int i; int i;
@ -170,7 +170,7 @@ aesni_encrypt1(unsigned char *out, __m128i nv, const __m128i rkeys[16])
/* create a function of unrolling N ; the MAKEN is the unrolling /* create a function of unrolling N ; the MAKEN is the unrolling
macro, defined above. The N in MAKEN must match N, obviously. */ macro, defined above. The N in MAKEN must match N, obviously. */
#define FUNC(N, MAKEN) \ #define FUNC(N, MAKEN) \
static inline void aesni_encrypt##N(unsigned char *out, uint32_t *n, const __m128i rkeys[16]) \ static inline void aesni_encrypt##N(unsigned char *out, uint32_t *n, const __m128i *rkeys) \
{ \ { \
const __m128i pt = _mm_set_epi8(12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \ const __m128i pt = _mm_set_epi8(12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
int i; \ int i; \
@ -398,7 +398,7 @@ reduce4(__m128i H0, __m128i H1, __m128i H2, __m128i H3, __m128i X0, __m128i X1,
/* full encrypt & checksum 8 blocks at once */ /* full encrypt & checksum 8 blocks at once */
static inline void static inline void
aesni_encrypt8full(unsigned char *out, uint32_t *n, const __m128i rkeys[16], aesni_encrypt8full(unsigned char *out, uint32_t *n, const __m128i *rkeys,
const unsigned char *in, unsigned char *accum, const unsigned char *in, unsigned char *accum,
const __m128i hv, const __m128i h2v, const __m128i h3v, const __m128i hv, const __m128i h2v, const __m128i h3v,
const __m128i h4v) const __m128i h4v)
@ -436,7 +436,7 @@ aesni_addmul8full(const unsigned char *in, unsigned char *accum,
/* decrypt 8 blocks at once */ /* decrypt 8 blocks at once */
static inline void static inline void
aesni_decrypt8full(unsigned char *out, uint32_t *n, const __m128i rkeys[16], aesni_decrypt8full(unsigned char *out, uint32_t *n, const __m128i *rkeys,
const unsigned char *in) const unsigned char *in)
{ {
const __m128i pt = _mm_set_epi8(12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); const __m128i pt = _mm_set_epi8(12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);