.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * aesce-ccm-core.S - AES-CCM transform for ARMv8 with Crypto Extensions |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2013 - 2017 Linaro Ltd <ard.biesheuvel@linaro.org> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License version 2 as |
---|
8 | | - * published by the Free Software Foundation. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #include <linux/linkage.h> |
---|
.. | .. |
---|
18 | 15 | * void ce_aes_ccm_auth_data(u8 mac[], u8 const in[], u32 abytes, |
---|
19 | 16 | * u32 *macp, u8 const rk[], u32 rounds); |
---|
20 | 17 | */ |
---|
21 | | -ENTRY(ce_aes_ccm_auth_data) |
---|
| 18 | +SYM_FUNC_START(ce_aes_ccm_auth_data) |
---|
22 | 19 | ldr w8, [x3] /* leftover from prev round? */ |
---|
23 | 20 | ld1 {v0.16b}, [x0] /* load mac */ |
---|
24 | 21 | cbz w8, 1f |
---|
.. | .. |
---|
84 | 81 | st1 {v0.16b}, [x0] |
---|
85 | 82 | 10: str w8, [x3] |
---|
86 | 83 | ret |
---|
87 | | -ENDPROC(ce_aes_ccm_auth_data) |
---|
| 84 | +SYM_FUNC_END(ce_aes_ccm_auth_data) |
---|
88 | 85 | |
---|
89 | 86 | /* |
---|
90 | 87 | * void ce_aes_ccm_final(u8 mac[], u8 const ctr[], u8 const rk[], |
---|
91 | 88 | * u32 rounds); |
---|
92 | 89 | */ |
---|
93 | | -ENTRY(ce_aes_ccm_final) |
---|
| 90 | +SYM_FUNC_START(ce_aes_ccm_final) |
---|
94 | 91 | ld1 {v3.4s}, [x2], #16 /* load first round key */ |
---|
95 | 92 | ld1 {v0.16b}, [x0] /* load mac */ |
---|
96 | 93 | cmp w3, #12 /* which key size? */ |
---|
.. | .. |
---|
124 | 121 | eor v0.16b, v0.16b, v1.16b /* en-/decrypt the mac */ |
---|
125 | 122 | st1 {v0.16b}, [x0] /* store result */ |
---|
126 | 123 | ret |
---|
127 | | -ENDPROC(ce_aes_ccm_final) |
---|
| 124 | +SYM_FUNC_END(ce_aes_ccm_final) |
---|
128 | 125 | |
---|
129 | 126 | .macro aes_ccm_do_crypt,enc |
---|
130 | 127 | ldr x8, [x6, #8] /* load lower ctr */ |
---|
.. | .. |
---|
215 | 212 | * u8 const rk[], u32 rounds, u8 mac[], |
---|
216 | 213 | * u8 ctr[]); |
---|
217 | 214 | */ |
---|
218 | | -ENTRY(ce_aes_ccm_encrypt) |
---|
| 215 | +SYM_FUNC_START(ce_aes_ccm_encrypt) |
---|
219 | 216 | aes_ccm_do_crypt 1 |
---|
220 | | -ENDPROC(ce_aes_ccm_encrypt) |
---|
| 217 | +SYM_FUNC_END(ce_aes_ccm_encrypt) |
---|
221 | 218 | |
---|
222 | | -ENTRY(ce_aes_ccm_decrypt) |
---|
| 219 | +SYM_FUNC_START(ce_aes_ccm_decrypt) |
---|
223 | 220 | aes_ccm_do_crypt 0 |
---|
224 | | -ENDPROC(ce_aes_ccm_decrypt) |
---|
| 221 | +SYM_FUNC_END(ce_aes_ccm_decrypt) |
---|