diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-08-06 18:31:18 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-08-06 19:25:29 +0200 |
commit | 1a72c38631b775529ba63aeec1f35df7080be609 (patch) | |
tree | 3377c9e1fbe00dbd45d90d2eb22dc524443b816d /src/crypto/chacha20.c | |
parent | 9160aae97794bac985d8dcb644a12c944fb11d33 (diff) |
crypto: move simd context to specific type
Suggested-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/chacha20.c')
-rw-r--r-- | src/crypto/chacha20.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/crypto/chacha20.c b/src/crypto/chacha20.c index a65ec8b..29f7e6b 100644 --- a/src/crypto/chacha20.c +++ b/src/crypto/chacha20.c @@ -151,9 +151,9 @@ static void chacha20_generic(u8 *out, const u8 *in, u32 len, const u32 key[8], c } } -void chacha20(struct chacha20_ctx *state, u8 *dst, const u8 *src, u32 len, bool have_simd) +void chacha20(struct chacha20_ctx *state, u8 *dst, const u8 *src, u32 len, simd_context_t simd_context) { - if (!have_simd + if (simd_context != HAVE_FULL_SIMD #if defined(CONFIG_X86_64) || !chacha20_use_ssse3 @@ -227,10 +227,10 @@ static void hchacha20_generic(u8 derived_key[CHACHA20_KEY_SIZE], const u8 nonce[ out[7] = cpu_to_le32(x[15]); } -void hchacha20(u8 derived_key[CHACHA20_KEY_SIZE], const u8 nonce[HCHACHA20_NONCE_SIZE], const u8 key[HCHACHA20_KEY_SIZE], bool have_simd) +void hchacha20(u8 derived_key[CHACHA20_KEY_SIZE], const u8 nonce[HCHACHA20_NONCE_SIZE], const u8 key[HCHACHA20_KEY_SIZE], simd_context_t simd_context) { #if defined(CONFIG_X86_64) && defined(CONFIG_AS_SSSE3) - if (have_simd && chacha20_use_ssse3) { + if (simd_context == HAVE_FULL_SIMD && chacha20_use_ssse3) { hchacha20_ssse3(derived_key, nonce, key); return; } |