diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-14 12:39:39 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-14 14:10:28 +0300 |
commit | 8d7de4dbf7732c6eb9e9853ad7c19c89075ace6f (patch) | |
tree | e6edfaad820279019bb0e2b705cbaee9086802c4 /cipher/poly1305.c | |
parent | b65e9e71d5ee992db5c96793c6af999545daad28 (diff) | |
download | libgcrypt-8d7de4dbf7732c6eb9e9853ad7c19c89075ace6f.tar.gz |
Enable AMD64 Poly1305 implementations on WIN64
* cipher/poly1305-avx2-amd64.S: Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(ELF): New macro to mask lines with ELF specific commands.
* cipher/poly1305-sse2-amd64.S: Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(ELF): New macro to mask lines with ELF specific commands.
* cipher/poly1305-internal.h (POLY1305_SYSV_FUNC_ABI): New.
(POLY1305_USE_SSE2, POLY1305_USE_AVX2): Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(OPS_FUNC_ABI): New.
(poly1305_ops_t): Use OPS_FUNC_ABI.
* cipher/poly1305.c (_gcry_poly1305_amd64_sse2_init_ext)
(_gcry_poly1305_amd64_sse2_finish_ext)
(_gcry_poly1305_amd64_sse2_blocks, _gcry_poly1305_amd64_avx2_init_ext)
(_gcry_poly1305_amd64_avx2_finish_ext)
(_gcry_poly1305_amd64_avx2_blocks, _gcry_poly1305_armv7_neon_init_ext)
(_gcry_poly1305_armv7_neon_finish_ext)
(_gcry_poly1305_armv7_neon_blocks, poly1305_init_ext_ref32)
(poly1305_blocks_ref32, poly1305_finish_ext_ref32)
(poly1305_init_ext_ref8, poly1305_blocks_ref8)
(poly1305_finish_ext_ref8): Use OPS_FUNC_ABI.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/poly1305.c')
-rw-r--r-- | cipher/poly1305.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/cipher/poly1305.c b/cipher/poly1305.c index 28dbbf8f..1adf0e7b 100644 --- a/cipher/poly1305.c +++ b/cipher/poly1305.c @@ -40,12 +40,13 @@ static const char *selftest (void); #ifdef POLY1305_USE_SSE2 -void _gcry_poly1305_amd64_sse2_init_ext(void *state, const poly1305_key_t *key); +void _gcry_poly1305_amd64_sse2_init_ext(void *state, const poly1305_key_t *key) + OPS_FUNC_ABI; unsigned int _gcry_poly1305_amd64_sse2_finish_ext(void *state, const byte *m, size_t remaining, - byte mac[16]); + byte mac[16]) OPS_FUNC_ABI; unsigned int _gcry_poly1305_amd64_sse2_blocks(void *ctx, const byte *m, - size_t bytes); + size_t bytes) OPS_FUNC_ABI; static const poly1305_ops_t poly1305_amd64_sse2_ops = { POLY1305_SSE2_BLOCKSIZE, @@ -59,12 +60,13 @@ static const poly1305_ops_t poly1305_amd64_sse2_ops = { #ifdef POLY1305_USE_AVX2 -void _gcry_poly1305_amd64_avx2_init_ext(void *state, const poly1305_key_t *key); +void _gcry_poly1305_amd64_avx2_init_ext(void *state, const poly1305_key_t *key) + OPS_FUNC_ABI; unsigned int _gcry_poly1305_amd64_avx2_finish_ext(void *state, const byte *m, size_t remaining, - byte mac[16]); + byte mac[16]) OPS_FUNC_ABI; unsigned int _gcry_poly1305_amd64_avx2_blocks(void *ctx, const byte *m, - size_t bytes); + size_t bytes) OPS_FUNC_ABI; static const poly1305_ops_t poly1305_amd64_avx2_ops = { POLY1305_AVX2_BLOCKSIZE, @@ -78,12 +80,13 @@ static const poly1305_ops_t poly1305_amd64_avx2_ops = { #ifdef POLY1305_USE_NEON -void _gcry_poly1305_armv7_neon_init_ext(void *state, const poly1305_key_t *key); +void _gcry_poly1305_armv7_neon_init_ext(void *state, const poly1305_key_t *key) + OPS_FUNC_ABI; unsigned int _gcry_poly1305_armv7_neon_finish_ext(void *state, const byte *m, size_t remaining, - byte mac[16]); + byte mac[16]) OPS_FUNC_ABI; unsigned int _gcry_poly1305_armv7_neon_blocks(void *ctx, const byte *m, - size_t bytes); + size_t bytes) OPS_FUNC_ABI; static const poly1305_ops_t poly1305_armv7_neon_ops = { POLY1305_NEON_BLOCKSIZE, @@ -110,7 +113,7 @@ typedef struct poly1305_state_ref32_s } poly1305_state_ref32_t; -static void +static OPS_FUNC_ABI void poly1305_init_ext_ref32 (void *state, const poly1305_key_t * key) { poly1305_state_ref32_t *st = (poly1305_state_ref32_t *) state; @@ -142,7 +145,7 @@ poly1305_init_ext_ref32 (void *state, const poly1305_key_t * key) } -static unsigned int +static OPS_FUNC_ABI unsigned int poly1305_blocks_ref32 (void *state, const byte * m, size_t bytes) { poly1305_state_ref32_t *st = (poly1305_state_ref32_t *) state; @@ -230,7 +233,7 @@ poly1305_blocks_ref32 (void *state, const byte * m, size_t bytes) } -static unsigned int +static OPS_FUNC_ABI unsigned int poly1305_finish_ext_ref32 (void *state, const byte * m, size_t remaining, byte mac[POLY1305_TAGLEN]) { @@ -370,7 +373,7 @@ typedef struct poly1305_state_ref8_t } poly1305_state_ref8_t; -static void +static OPS_FUNC_ABI void poly1305_init_ext_ref8 (void *state, const poly1305_key_t * key) { poly1305_state_ref8_t *st = (poly1305_state_ref8_t *) state; @@ -471,7 +474,7 @@ poly1305_freeze_ref8 (byte h[17]) } -static unsigned int +static OPS_FUNC_ABI unsigned int poly1305_blocks_ref8 (void *state, const byte * m, size_t bytes) { poly1305_state_ref8_t *st = (poly1305_state_ref8_t *) state; @@ -519,7 +522,7 @@ poly1305_blocks_ref8 (void *state, const byte * m, size_t bytes) } -static unsigned int +static OPS_FUNC_ABI unsigned int poly1305_finish_ext_ref8 (void *state, const byte * m, size_t remaining, byte mac[POLY1305_TAGLEN]) { |