1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2013 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org>
6 #include <linux/linkage.h>
7 #include <asm/assembler.h>
11 SYM_FUNC_START(__aes_ce_encrypt)
14 ld1 {v1.4s}, [x0], #16
21 ld1 {v3.4s}, [x0], #16
22 1: aese v0.16b, v2.16b
24 2: ld1 {v1.4s}, [x0], #16
27 3: ld1 {v2.4s}, [x0], #16
31 ld1 {v3.4s}, [x0], #16
34 eor v0.16b, v0.16b, v3.16b
37 SYM_FUNC_END(__aes_ce_encrypt)
39 SYM_FUNC_START(__aes_ce_decrypt)
42 ld1 {v1.4s}, [x0], #16
49 ld1 {v3.4s}, [x0], #16
50 1: aesd v0.16b, v2.16b
52 2: ld1 {v1.4s}, [x0], #16
55 3: ld1 {v2.4s}, [x0], #16
59 ld1 {v3.4s}, [x0], #16
62 eor v0.16b, v0.16b, v3.16b
65 SYM_FUNC_END(__aes_ce_decrypt)
68 * __aes_ce_sub() - use the aese instruction to perform the AES sbox
69 * substitution on each byte in 'input'
71 SYM_FUNC_START(__aes_ce_sub)
77 SYM_FUNC_END(__aes_ce_sub)
79 SYM_FUNC_START(__aes_ce_invert)
84 SYM_FUNC_END(__aes_ce_invert)