2 * Copyright (C) 2013 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include <linux/linkage.h>
10 #include <asm/assembler.h>
14 ENTRY(__aes_ce_encrypt)
17 ld1 {v1.4s}, [x0], #16
24 ld1 {v3.4s}, [x0], #16
25 1: aese v0.16b, v2.16b
27 2: ld1 {v1.4s}, [x0], #16
30 3: ld1 {v2.4s}, [x0], #16
34 ld1 {v3.4s}, [x0], #16
37 eor v0.16b, v0.16b, v3.16b
40 ENDPROC(__aes_ce_encrypt)
42 ENTRY(__aes_ce_decrypt)
45 ld1 {v1.4s}, [x0], #16
52 ld1 {v3.4s}, [x0], #16
53 1: aesd v0.16b, v2.16b
55 2: ld1 {v1.4s}, [x0], #16
58 3: ld1 {v2.4s}, [x0], #16
62 ld1 {v3.4s}, [x0], #16
65 eor v0.16b, v0.16b, v3.16b
68 ENDPROC(__aes_ce_decrypt)
71 * __aes_ce_sub() - use the aese instruction to perform the AES sbox
72 * substitution on each byte in 'input'
82 ENTRY(__aes_ce_invert)
87 ENDPROC(__aes_ce_invert)