Lines Matching +full:1 +full:- +full:16

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * SM4-CCM AEAD Algorithm using ARMv8 Crypto Extensions
13 #include "sm4-ce-asm.h"
15 .arch armv8-a+crypto
17 .irp b, 0, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 24, 25, 26, 27, 28, 29, 30, 31
32 mov vctr.d[1], x8; \
34 adds x8, x8, #1; \
35 rev64 vctr.16b, vctr.16b; \
49 ld1 {RMAC.16b}, [x1]
57 ld1 {v0.16b-v3.16b}, [x2], #64
60 eor RMAC.16b, RMAC.16b, v0.16b
62 eor RMAC.16b, RMAC.16b, v1.16b
64 eor RMAC.16b, RMAC.16b, v2.16b
66 eor RMAC.16b, RMAC.16b, v3.16b
72 sub w3, w3, #1
74 ld1 {v0.16b}, [x2], #16
77 eor RMAC.16b, RMAC.16b, v0.16b
82 st1 {RMAC.16b}, [x1]
95 ld1 {RMAC.16b}, [x2]
96 ld1 {v0.16b}, [x1]
100 /* en-/decrypt the mac with ctr0 */
101 eor RMAC.16b, RMAC.16b, v0.16b
102 st1 {RMAC.16b}, [x2]
123 ld1 {RMAC.16b}, [x5]
126 cmp w4, #(4 * 16)
129 sub w4, w4, #(4 * 16)
133 inc_le128(v9) /* +1 */
137 ld1 {v0.16b-v3.16b}, [x2], #64
140 eor v8.16b, v8.16b, v0.16b
141 eor RMAC.16b, RMAC.16b, v0.16b
143 eor v9.16b, v9.16b, v1.16b
144 eor RMAC.16b, RMAC.16b, v1.16b
146 eor v10.16b, v10.16b, v2.16b
147 eor RMAC.16b, RMAC.16b, v2.16b
149 eor v11.16b, v11.16b, v3.16b
150 eor RMAC.16b, RMAC.16b, v3.16b
152 st1 {v8.16b-v11.16b}, [x1], #64
158 cmp w4, #16
161 sub w4, w4, #16
166 ld1 {v0.16b}, [x2], #16
169 eor v8.16b, v8.16b, v0.16b
170 eor RMAC.16b, RMAC.16b, v0.16b
172 st1 {v8.16b}, [x1], #16
184 st1 {RMAC.16b}, [x5]
187 ldrb w0, [x2], #1 /* get 1 byte from input */
194 strb w9, [x1], #1 /* store out byte */
195 strb w6, [x5], #1 /* store MAC byte */
197 subs w4, w4, #1
201 ext RMAC.16b, RMAC.16b, RMAC.16b, #1
202 ext v8.16b, v8.16b, v8.16b, #1
208 st1 {RMAC.16b}, [x5]
235 ld1 {RMAC.16b}, [x5]
238 cmp w4, #(4 * 16)
241 sub w4, w4, #(4 * 16)
245 inc_le128(v9) /* +1 */
249 ld1 {v0.16b-v3.16b}, [x2], #64
252 eor v8.16b, v8.16b, v0.16b
253 eor RMAC.16b, RMAC.16b, v8.16b
255 eor v9.16b, v9.16b, v1.16b
256 eor RMAC.16b, RMAC.16b, v9.16b
258 eor v10.16b, v10.16b, v2.16b
259 eor RMAC.16b, RMAC.16b, v10.16b
261 eor v11.16b, v11.16b, v3.16b
262 eor RMAC.16b, RMAC.16b, v11.16b
264 st1 {v8.16b-v11.16b}, [x1], #64
270 cmp w4, #16
273 sub w4, w4, #16
278 ld1 {v0.16b}, [x2], #16
281 eor v8.16b, v8.16b, v0.16b
282 eor RMAC.16b, RMAC.16b, v8.16b
284 st1 {v8.16b}, [x1], #16
296 st1 {RMAC.16b}, [x5]
299 ldrb w0, [x2], #1 /* get 1 byte from input */
306 strb w9, [x1], #1 /* store out byte */
307 strb w6, [x5], #1 /* store MAC byte */
309 subs w4, w4, #1
313 ext RMAC.16b, RMAC.16b, RMAC.16b, #1
314 ext v8.16b, v8.16b, v8.16b, #1
320 st1 {RMAC.16b}, [x5]