x86/asm: Change all ENTRY+ENDPROC to SYM_FUNC_*
[linux-2.6-block.git] / crypto / aegis128-neon.c
CommitLineData
a4397635
AB
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (C) 2019 Linaro Ltd <ard.biesheuvel@linaro.org>
4 */
5
6#include <asm/cpufeature.h>
7#include <asm/neon.h>
8
9#include "aegis.h"
10
11void crypto_aegis128_update_neon(void *state, const void *msg);
12void crypto_aegis128_encrypt_chunk_neon(void *state, void *dst, const void *src,
13 unsigned int size);
14void crypto_aegis128_decrypt_chunk_neon(void *state, void *dst, const void *src,
15 unsigned int size);
16
19842963
AB
17int aegis128_have_aes_insn __ro_after_init;
18
a4397635
AB
19bool crypto_aegis128_have_simd(void)
20{
19842963
AB
21 if (cpu_have_feature(cpu_feature(AES))) {
22 aegis128_have_aes_insn = 1;
23 return true;
24 }
25 return IS_ENABLED(CONFIG_ARM64);
a4397635
AB
26}
27
28void crypto_aegis128_update_simd(union aegis_block *state, const void *msg)
29{
30 kernel_neon_begin();
31 crypto_aegis128_update_neon(state, msg);
32 kernel_neon_end();
33}
34
35void crypto_aegis128_encrypt_chunk_simd(union aegis_block *state, u8 *dst,
36 const u8 *src, unsigned int size)
37{
38 kernel_neon_begin();
39 crypto_aegis128_encrypt_chunk_neon(state, dst, src, size);
40 kernel_neon_end();
41}
42
43void crypto_aegis128_decrypt_chunk_simd(union aegis_block *state, u8 *dst,
44 const u8 *src, unsigned int size)
45{
46 kernel_neon_begin();
47 crypto_aegis128_decrypt_chunk_neon(state, dst, src, size);
48 kernel_neon_end();
49}