tracing/hwlat: Honor the tracing_cpumask
[linux/fpc-iii.git] / crypto / aegis128-neon.c
blob751f9c195aa42a0b43916c16362e15b32497000c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (C) 2019 Linaro Ltd <ard.biesheuvel@linaro.org>
4 */
6 #include <asm/cpufeature.h>
7 #include <asm/neon.h>
9 #include "aegis.h"
11 void crypto_aegis128_update_neon(void *state, const void *msg);
12 void crypto_aegis128_encrypt_chunk_neon(void *state, void *dst, const void *src,
13 unsigned int size);
14 void crypto_aegis128_decrypt_chunk_neon(void *state, void *dst, const void *src,
15 unsigned int size);
17 int aegis128_have_aes_insn __ro_after_init;
19 bool crypto_aegis128_have_simd(void)
21 if (cpu_have_feature(cpu_feature(AES))) {
22 aegis128_have_aes_insn = 1;
23 return true;
25 return IS_ENABLED(CONFIG_ARM64);
28 void crypto_aegis128_update_simd(union aegis_block *state, const void *msg)
30 kernel_neon_begin();
31 crypto_aegis128_update_neon(state, msg);
32 kernel_neon_end();
35 void crypto_aegis128_encrypt_chunk_simd(union aegis_block *state, u8 *dst,
36 const u8 *src, unsigned int size)
38 kernel_neon_begin();
39 crypto_aegis128_encrypt_chunk_neon(state, dst, src, size);
40 kernel_neon_end();
43 void crypto_aegis128_decrypt_chunk_simd(union aegis_block *state, u8 *dst,
44 const u8 *src, unsigned int size)
46 kernel_neon_begin();
47 crypto_aegis128_decrypt_chunk_neon(state, dst, src, size);
48 kernel_neon_end();