aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-17 05:49:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-17 06:03:01 +0200
commit34fd8f675f6094eecaa336bf1e294cf808a35ce3 (patch)
treefec0983301001191b99d8ec47262499e57a15a56 /src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
parentchacha20-x86_64: cascade down implementations (diff)
downloadwireguard-monolithic-historical-34fd8f675f6094eecaa336bf1e294cf808a35ce3.tar.xz
wireguard-monolithic-historical-34fd8f675f6094eecaa336bf1e294cf808a35ce3.zip
crypto: pass simd by reference
Diffstat (limited to 'src/crypto/zinc/poly1305/poly1305-x86_64-glue.h')
-rw-r--r--src/crypto/zinc/poly1305/poly1305-x86_64-glue.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
index 7f1af44..1afd1c5 100644
--- a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
+++ b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
@@ -63,20 +63,20 @@ static inline bool poly1305_init_arch(void *ctx,
static inline bool poly1305_blocks_arch(void *ctx, const u8 *inp,
const size_t len, const u32 padbit,
- simd_context_t simd_context)
+ simd_context_t *simd_context)
{
#ifdef CONFIG_AS_AVX512
- if (poly1305_use_avx512 && simd_context == HAVE_FULL_SIMD)
+ if (poly1305_use_avx512 && simd_use(simd_context))
poly1305_blocks_avx512(ctx, inp, len, padbit);
else
#endif
#ifdef CONFIG_AS_AVX2
- if (poly1305_use_avx2 && simd_context == HAVE_FULL_SIMD)
+ if (poly1305_use_avx2 && simd_use(simd_context))
poly1305_blocks_avx2(ctx, inp, len, padbit);
else
#endif
#ifdef CONFIG_AS_AVX
- if (poly1305_use_avx && simd_context == HAVE_FULL_SIMD)
+ if (poly1305_use_avx && simd_use(simd_context))
poly1305_blocks_avx(ctx, inp, len, padbit);
else
#endif
@@ -86,20 +86,20 @@ static inline bool poly1305_blocks_arch(void *ctx, const u8 *inp,
static inline bool poly1305_emit_arch(void *ctx, u8 mac[POLY1305_MAC_SIZE],
const u32 nonce[4],
- simd_context_t simd_context)
+ simd_context_t *simd_context)
{
#ifdef CONFIG_AS_AVX512
- if (poly1305_use_avx512 && simd_context == HAVE_FULL_SIMD)
+ if (poly1305_use_avx512 && simd_use(simd_context))
poly1305_emit_avx(ctx, mac, nonce);
else
#endif
#ifdef CONFIG_AS_AVX2
- if (poly1305_use_avx2 && simd_context == HAVE_FULL_SIMD)
+ if (poly1305_use_avx2 && simd_use(simd_context))
poly1305_emit_avx(ctx, mac, nonce);
else
#endif
#ifdef CONFIG_AS_AVX
- if (poly1305_use_avx && simd_context == HAVE_FULL_SIMD)
+ if (poly1305_use_avx && simd_use(simd_context))
poly1305_emit_avx(ctx, mac, nonce);
else
#endif