Lines Matching +full:4 +full:- +full:16

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 * https://tools.ietf.org/id/draft-ribose-cfrg-sm4-10.html
14 .arch armv8-a+crypto
16 .irp b, 0, 1, 2, 3, 4, 5, 6, 7, 16, 20, 24, 25, 26, 27, 28, 29, 30, 31
17 .set .Lv\b\().4s, \b
25 .inst 0xce60c800 | (.L\vm << 16) | (.L\vn << 5) | .L\vd
40 ld1 {v24.16b-v27.16b}, [x0], #64; \
41 ld1 {v28.16b-v31.16b}, [x0];
44 rev32 b0.16b, b0.16b; \
45 sm4e b0.4s, v24.4s; \
46 sm4e b0.4s, v25.4s; \
47 sm4e b0.4s, v26.4s; \
48 sm4e b0.4s, v27.4s; \
49 sm4e b0.4s, v28.4s; \
50 sm4e b0.4s, v29.4s; \
51 sm4e b0.4s, v30.4s; \
52 sm4e b0.4s, v31.4s; \
53 rev64 b0.4s, b0.4s; \
54 ext b0.16b, b0.16b, b0.16b, #8; \
55 rev32 b0.16b, b0.16b;
58 rev32 b0.16b, b0.16b; \
59 rev32 b1.16b, b1.16b; \
60 rev32 b2.16b, b2.16b; \
61 rev32 b3.16b, b3.16b; \
62 sm4e b0.4s, v24.4s; \
63 sm4e b1.4s, v24.4s; \
64 sm4e b2.4s, v24.4s; \
65 sm4e b3.4s, v24.4s; \
66 sm4e b0.4s, v25.4s; \
67 sm4e b1.4s, v25.4s; \
68 sm4e b2.4s, v25.4s; \
69 sm4e b3.4s, v25.4s; \
70 sm4e b0.4s, v26.4s; \
71 sm4e b1.4s, v26.4s; \
72 sm4e b2.4s, v26.4s; \
73 sm4e b3.4s, v26.4s; \
74 sm4e b0.4s, v27.4s; \
75 sm4e b1.4s, v27.4s; \
76 sm4e b2.4s, v27.4s; \
77 sm4e b3.4s, v27.4s; \
78 sm4e b0.4s, v28.4s; \
79 sm4e b1.4s, v28.4s; \
80 sm4e b2.4s, v28.4s; \
81 sm4e b3.4s, v28.4s; \
82 sm4e b0.4s, v29.4s; \
83 sm4e b1.4s, v29.4s; \
84 sm4e b2.4s, v29.4s; \
85 sm4e b3.4s, v29.4s; \
86 sm4e b0.4s, v30.4s; \
87 sm4e b1.4s, v30.4s; \
88 sm4e b2.4s, v30.4s; \
89 sm4e b3.4s, v30.4s; \
90 sm4e b0.4s, v31.4s; \
91 sm4e b1.4s, v31.4s; \
92 sm4e b2.4s, v31.4s; \
93 sm4e b3.4s, v31.4s; \
94 rev64 b0.4s, b0.4s; \
95 rev64 b1.4s, b1.4s; \
96 rev64 b2.4s, b2.4s; \
97 rev64 b3.4s, b3.4s; \
98 ext b0.16b, b0.16b, b0.16b, #8; \
99 ext b1.16b, b1.16b, b1.16b, #8; \
100 ext b2.16b, b2.16b, b2.16b, #8; \
101 ext b3.16b, b3.16b, b3.16b, #8; \
102 rev32 b0.16b, b0.16b; \
103 rev32 b1.16b, b1.16b; \
104 rev32 b2.16b, b2.16b; \
105 rev32 b3.16b, b3.16b;
108 rev32 b0.16b, b0.16b; \
109 rev32 b1.16b, b1.16b; \
110 rev32 b2.16b, b2.16b; \
111 rev32 b3.16b, b3.16b; \
112 rev32 b4.16b, b4.16b; \
113 rev32 b5.16b, b5.16b; \
114 rev32 b6.16b, b6.16b; \
115 rev32 b7.16b, b7.16b; \
116 sm4e b0.4s, v24.4s; \
117 sm4e b1.4s, v24.4s; \
118 sm4e b2.4s, v24.4s; \
119 sm4e b3.4s, v24.4s; \
120 sm4e b4.4s, v24.4s; \
121 sm4e b5.4s, v24.4s; \
122 sm4e b6.4s, v24.4s; \
123 sm4e b7.4s, v24.4s; \
124 sm4e b0.4s, v25.4s; \
125 sm4e b1.4s, v25.4s; \
126 sm4e b2.4s, v25.4s; \
127 sm4e b3.4s, v25.4s; \
128 sm4e b4.4s, v25.4s; \
129 sm4e b5.4s, v25.4s; \
130 sm4e b6.4s, v25.4s; \
131 sm4e b7.4s, v25.4s; \
132 sm4e b0.4s, v26.4s; \
133 sm4e b1.4s, v26.4s; \
134 sm4e b2.4s, v26.4s; \
135 sm4e b3.4s, v26.4s; \
136 sm4e b4.4s, v26.4s; \
137 sm4e b5.4s, v26.4s; \
138 sm4e b6.4s, v26.4s; \
139 sm4e b7.4s, v26.4s; \
140 sm4e b0.4s, v27.4s; \
141 sm4e b1.4s, v27.4s; \
142 sm4e b2.4s, v27.4s; \
143 sm4e b3.4s, v27.4s; \
144 sm4e b4.4s, v27.4s; \
145 sm4e b5.4s, v27.4s; \
146 sm4e b6.4s, v27.4s; \
147 sm4e b7.4s, v27.4s; \
148 sm4e b0.4s, v28.4s; \
149 sm4e b1.4s, v28.4s; \
150 sm4e b2.4s, v28.4s; \
151 sm4e b3.4s, v28.4s; \
152 sm4e b4.4s, v28.4s; \
153 sm4e b5.4s, v28.4s; \
154 sm4e b6.4s, v28.4s; \
155 sm4e b7.4s, v28.4s; \
156 sm4e b0.4s, v29.4s; \
157 sm4e b1.4s, v29.4s; \
158 sm4e b2.4s, v29.4s; \
159 sm4e b3.4s, v29.4s; \
160 sm4e b4.4s, v29.4s; \
161 sm4e b5.4s, v29.4s; \
162 sm4e b6.4s, v29.4s; \
163 sm4e b7.4s, v29.4s; \
164 sm4e b0.4s, v30.4s; \
165 sm4e b1.4s, v30.4s; \
166 sm4e b2.4s, v30.4s; \
167 sm4e b3.4s, v30.4s; \
168 sm4e b4.4s, v30.4s; \
169 sm4e b5.4s, v30.4s; \
170 sm4e b6.4s, v30.4s; \
171 sm4e b7.4s, v30.4s; \
172 sm4e b0.4s, v31.4s; \
173 sm4e b1.4s, v31.4s; \
174 sm4e b2.4s, v31.4s; \
175 sm4e b3.4s, v31.4s; \
176 sm4e b4.4s, v31.4s; \
177 sm4e b5.4s, v31.4s; \
178 sm4e b6.4s, v31.4s; \
179 sm4e b7.4s, v31.4s; \
180 rev64 b0.4s, b0.4s; \
181 rev64 b1.4s, b1.4s; \
182 rev64 b2.4s, b2.4s; \
183 rev64 b3.4s, b3.4s; \
184 rev64 b4.4s, b4.4s; \
185 rev64 b5.4s, b5.4s; \
186 rev64 b6.4s, b6.4s; \
187 rev64 b7.4s, b7.4s; \
188 ext b0.16b, b0.16b, b0.16b, #8; \
189 ext b1.16b, b1.16b, b1.16b, #8; \
190 ext b2.16b, b2.16b, b2.16b, #8; \
191 ext b3.16b, b3.16b, b3.16b, #8; \
192 ext b4.16b, b4.16b, b4.16b, #8; \
193 ext b5.16b, b5.16b, b5.16b, #8; \
194 ext b6.16b, b6.16b, b6.16b, #8; \
195 ext b7.16b, b7.16b, b7.16b, #8; \
196 rev32 b0.16b, b0.16b; \
197 rev32 b1.16b, b1.16b; \
198 rev32 b2.16b, b2.16b; \
199 rev32 b3.16b, b3.16b; \
200 rev32 b4.16b, b4.16b; \
201 rev32 b5.16b, b5.16b; \
202 rev32 b6.16b, b6.16b; \
203 rev32 b7.16b, b7.16b;
209 * x0: 128-bit key
215 ld1 {v0.16b}, [x0];
216 rev32 v0.16b, v0.16b;
217 ld1 {v1.16b}, [x3];
219 ld1 {v24.16b-v27.16b}, [x4], #64;
220 ld1 {v28.16b-v31.16b}, [x4];
223 eor v0.16b, v0.16b, v1.16b;
225 sm4ekey v0.4s, v0.4s, v24.4s;
226 sm4ekey v1.4s, v0.4s, v25.4s;
227 sm4ekey v2.4s, v1.4s, v26.4s;
228 sm4ekey v3.4s, v2.4s, v27.4s;
229 sm4ekey v4.4s, v3.4s, v28.4s;
230 sm4ekey v5.4s, v4.4s, v29.4s;
231 sm4ekey v6.4s, v5.4s, v30.4s;
232 sm4ekey v7.4s, v6.4s, v31.4s;
234 st1 {v0.16b-v3.16b}, [x1], #64;
235 st1 {v4.16b-v7.16b}, [x1];
236 rev64 v7.4s, v7.4s;
237 rev64 v6.4s, v6.4s;
238 rev64 v5.4s, v5.4s;
239 rev64 v4.4s, v4.4s;
240 rev64 v3.4s, v3.4s;
241 rev64 v2.4s, v2.4s;
242 rev64 v1.4s, v1.4s;
243 rev64 v0.4s, v0.4s;
244 ext v7.16b, v7.16b, v7.16b, #8;
245 ext v6.16b, v6.16b, v6.16b, #8;
246 ext v5.16b, v5.16b, v5.16b, #8;
247 ext v4.16b, v4.16b, v4.16b, #8;
248 ext v3.16b, v3.16b, v3.16b, #8;
249 ext v2.16b, v2.16b, v2.16b, #8;
250 ext v1.16b, v1.16b, v1.16b, #8;
251 ext v0.16b, v0.16b, v0.16b, #8;
252 st1 {v7.16b}, [x2], #16;
253 st1 {v6.16b}, [x2], #16;
254 st1 {v5.16b}, [x2], #16;
255 st1 {v4.16b}, [x2], #16;
256 st1 {v3.16b}, [x2], #16;
257 st1 {v2.16b}, [x2], #16;
258 st1 {v1.16b}, [x2], #16;
259 st1 {v0.16b}, [x2];
273 ld1 {v0.16b}, [x2];
275 st1 {v0.16b}, [x1];
294 ld1 {v0.16b-v3.16b}, [x2], #64;
295 ld1 {v4.16b-v7.16b}, [x2], #64;
299 st1 {v0.16b-v3.16b}, [x1], #64;
300 st1 {v4.16b-v7.16b}, [x1], #64;
307 cmp w3, #4;
310 sub w3, w3, #4;
312 ld1 {v0.16b-v3.16b}, [x2], #64;
314 st1 {v0.16b-v3.16b}, [x1], #64;
321 ld1 {v0.16b}, [x2], #16;
323 st1 {v0.16b}, [x1], #16;
342 ld1 {RIV.16b}, [x3];
347 ld1 {RTMP0.16b}, [x2], #16;
348 eor RIV.16b, RIV.16b, RTMP0.16b;
352 st1 {RIV.16b}, [x1], #16;
357 st1 {RIV.16b}, [x3];
373 ld1 {RIV.16b}, [x3];
379 ld1 {v0.16b-v3.16b}, [x2], #64;
380 ld1 {v4.16b-v7.16b}, [x2];
385 eor v0.16b, v0.16b, RIV.16b;
386 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
387 eor v1.16b, v1.16b, RTMP0.16b;
388 eor v2.16b, v2.16b, RTMP1.16b;
389 eor v3.16b, v3.16b, RTMP2.16b;
390 st1 {v0.16b-v3.16b}, [x1], #64;
392 eor v4.16b, v4.16b, RTMP3.16b;
393 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
394 eor v5.16b, v5.16b, RTMP0.16b;
395 eor v6.16b, v6.16b, RTMP1.16b;
396 eor v7.16b, v7.16b, RTMP2.16b;
398 mov RIV.16b, RTMP3.16b;
399 st1 {v4.16b-v7.16b}, [x1], #64;
406 cmp w4, #4;
409 sub w4, w4, #4;
411 ld1 {v0.16b-v3.16b}, [x2];
415 eor v0.16b, v0.16b, RIV.16b;
416 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
417 eor v1.16b, v1.16b, RTMP0.16b;
418 eor v2.16b, v2.16b, RTMP1.16b;
419 eor v3.16b, v3.16b, RTMP2.16b;
421 mov RIV.16b, RTMP3.16b;
422 st1 {v0.16b-v3.16b}, [x1], #64;
429 ld1 {v0.16b}, [x2];
433 eor v0.16b, v0.16b, RIV.16b;
434 ld1 {RIV.16b}, [x2], #16;
435 st1 {v0.16b}, [x1], #16;
441 st1 {RIV.16b}, [x3];
457 ld1 {RIV.16b}, [x3];
464 ld1 {RTMP0.16b}, [x2], #16;
465 eor RIV.16b, RIV.16b, RTMP0.16b;
466 st1 {RIV.16b}, [x1], #16;
471 st1 {RIV.16b}, [x3];
487 ld1 {v0.16b}, [x3];
493 ld1 {v1.16b, v2.16b, v3.16b}, [x2], #48;
494 ld1 {v4.16b-v7.16b}, [x2];
499 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
500 eor v0.16b, v0.16b, RTMP0.16b;
501 eor v1.16b, v1.16b, RTMP1.16b;
502 eor v2.16b, v2.16b, RTMP2.16b;
503 eor v3.16b, v3.16b, RTMP3.16b;
504 st1 {v0.16b-v3.16b}, [x1], #64;
506 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
507 eor v4.16b, v4.16b, RTMP0.16b;
508 eor v5.16b, v5.16b, RTMP1.16b;
509 eor v6.16b, v6.16b, RTMP2.16b;
510 eor v7.16b, v7.16b, RTMP3.16b;
511 st1 {v4.16b-v7.16b}, [x1], #64;
513 mov v0.16b, RTMP3.16b;
520 cmp w4, #4;
523 sub w4, w4, #4;
525 ld1 {v1.16b, v2.16b, v3.16b}, [x2];
529 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
530 eor v0.16b, v0.16b, RTMP0.16b;
531 eor v1.16b, v1.16b, RTMP1.16b;
532 eor v2.16b, v2.16b, RTMP2.16b;
533 eor v3.16b, v3.16b, RTMP3.16b;
534 st1 {v0.16b-v3.16b}, [x1], #64;
536 mov v0.16b, RTMP3.16b;
545 ld1 {RTMP0.16b}, [x2], #16;
546 eor v0.16b, v0.16b, RTMP0.16b;
547 st1 {v0.16b}, [x1], #16;
549 mov v0.16b, RTMP0.16b;
555 st1 {v0.16b}, [x3];
584 rev64 vctr.16b, vctr.16b;
591 inc_le128(v4); /* +4 */
598 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
599 eor v0.16b, v0.16b, RTMP0.16b;
600 eor v1.16b, v1.16b, RTMP1.16b;
601 eor v2.16b, v2.16b, RTMP2.16b;
602 eor v3.16b, v3.16b, RTMP3.16b;
603 st1 {v0.16b-v3.16b}, [x1], #64;
605 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
606 eor v4.16b, v4.16b, RTMP0.16b;
607 eor v5.16b, v5.16b, RTMP1.16b;
608 eor v6.16b, v6.16b, RTMP2.16b;
609 eor v7.16b, v7.16b, RTMP3.16b;
610 st1 {v4.16b-v7.16b}, [x1], #64;
617 cmp w4, #4;
620 sub w4, w4, #4;
630 ld1 {RTMP0.16b-RTMP3.16b}, [x2], #64;
631 eor v0.16b, v0.16b, RTMP0.16b;
632 eor v1.16b, v1.16b, RTMP1.16b;
633 eor v2.16b, v2.16b, RTMP2.16b;
634 eor v3.16b, v3.16b, RTMP3.16b;
635 st1 {v0.16b-v3.16b}, [x1], #64;
647 ld1 {RTMP0.16b}, [x2], #16;
648 eor v0.16b, v0.16b, RTMP0.16b;
649 st1 {v0.16b}, [x1], #16;