Debian Codegraph @

debian/s2n-bignum/arm/curve25519/curve25519_x25519_byte.S

raw
1 // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 // SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT-0
3
4 // **********************************************************************
5 // This code is substantially derived from Emil Lenngren's implementation
6 //
7 // https://github.com/Emill/X25519-AArch64/blob/master/X25519_AArch64.pdf
8 // https://github.com/Emill/X25519-AArch64
9 //
10 // and the SLOTHY-based re-engineering of that code by Abdulrahman, Becker,
11 // Kannwischer and Klein:
12 //
13 // https://eprint.iacr.org/2022/1303.pdf
14 // https://github.com/slothy-optimizer/slothy/tree/main/paper
15 // **********************************************************************
16
17 // ----------------------------------------------------------------------------
18 // The x25519 function for curve25519 (byte array arguments)
19 // Inputs scalar[32] (bytes), point[32] (bytes); output res[32] (bytes)
20 //
21 // extern void curve25519_x25519_byte
22 // (uint8_t res[static 32],uint8_t scalar[static 32],uint8_t point[static 32])
23 //
24 // Given a scalar n and the X coordinate of an input point P = (X,Y) on
25 // curve25519 (Y can live in any extension field of characteristic 2^255-19),
26 // this returns the X coordinate of n * P = (X, Y), or 0 when n * P is the
27 // point at infinity. Both n and X inputs are first slightly modified/mangled
28 // as specified in the relevant RFC (https://www.rfc-editor.org/rfc/rfc7748);
29 // in particular the lower three bits of n are set to zero. Does not implement
30 // the zero-check specified in Section 6.1.
31 //
32 // Standard ARM ABI: X0 = res, X1 = scalar, X2 = point
33 // ----------------------------------------------------------------------------
34 #include "_internal_s2n_bignum.h"
35
36 S2N_BN_SYM_VISIBILITY_DIRECTIVE(curve25519_x25519_byte)
37 S2N_BN_SYM_PRIVACY_DIRECTIVE(curve25519_x25519_byte)
38
39 .text
40 .balign 4
41
42 // Pointer-offset pairs for temporaries on stack
43
44 #define scalar sp, #0
45 #define pointx sp, #32
46 #define mask1 sp, #72
47 #define mask2 sp, #80
48 #define tmpa sp, #88
49 #define tmpb sp, #128
50 #define xn sp, #128
51 #define zn sp, #160
52
53 #define res sp, #192
54 #define i sp, #200
55 #define swap sp, #208
56
57 // Total size to reserve on the stack
58
59 #define NSPACE 224
60 #define regsave sp, #NSPACE
61
62 S2N_BN_SYMBOL(curve25519_x25519_byte):
63
64 // Save registers and make additional room NSPACE for temporaries.
65 // We only need to save the low 64-bits of the Q8...Q15 registers
66 // according to the ABI, so we use a save of the D8...D15 forms.
67
68 sub sp, sp, #NSPACE+160
69 stp d8, d9, [regsave+0]
70 stp d10, d11, [regsave+16]
71 stp d12, d13, [regsave+32]
72 stp d14, d15, [regsave+48]
73 stp x19, x20, [regsave+64]
74 stp x21, x22, [regsave+80]
75 stp x23, x24, [regsave+96]
76 stp x25, x26, [regsave+112]
77 stp x27, x28, [regsave+128]
78 stp x29, x30, [regsave+144]
79
80 // Move the output pointer to a stable place
81
82 str x0, [res]
83
84 // Copy the scalar to the corresponding local variable while
85 // mangling it. In principle it becomes 01xxx...xxx000 where
86 // the xxx are the corresponding bits of the original input
87 // scalar. We actually don't bother forcing the MSB to zero,
88 // but rather start the main loop below at 254 instead of 255.
89
90 ldrb w10, [x1]
91 ldrb w0, [x1, #1]
92 orr x10, x10, x0, lsl #8
93 ldrb w0, [x1, #2]
94 orr x10, x10, x0, lsl #16
95 ldrb w0, [x1, #3]
96 orr x10, x10, x0, lsl #24
97 ldrb w0, [x1, #4]
98 orr x10, x10, x0, lsl #32
99 ldrb w0, [x1, #5]
100 orr x10, x10, x0, lsl #40
101 ldrb w0, [x1, #6]
102 orr x10, x10, x0, lsl #48
103 ldrb w0, [x1, #7]
104 orr x10, x10, x0, lsl #56
105 ldrb w11, [x1, #8]
106 ldrb w0, [x1, #9]
107 orr x11, x11, x0, lsl #8
108 ldrb w0, [x1, #10]
109 orr x11, x11, x0, lsl #16
110 ldrb w0, [x1, #11]
111 orr x11, x11, x0, lsl #24
112 ldrb w0, [x1, #12]
113 orr x11, x11, x0, lsl #32
114 ldrb w0, [x1, #13]
115 orr x11, x11, x0, lsl #40
116 ldrb w0, [x1, #14]
117 orr x11, x11, x0, lsl #48
118 ldrb w0, [x1, #15]
119 orr x11, x11, x0, lsl #56
120 bic x10, x10, #7
121 stp x10, x11, [scalar]
122
123 ldrb w12, [x1, #16]
124 ldrb w0, [x1, #17]
125 orr x12, x12, x0, lsl #8
126 ldrb w0, [x1, #18]
127 orr x12, x12, x0, lsl #16
128 ldrb w0, [x1, #19]
129 orr x12, x12, x0, lsl #24
130 ldrb w0, [x1, #20]
131 orr x12, x12, x0, lsl #32
132 ldrb w0, [x1, #21]
133 orr x12, x12, x0, lsl #40
134 ldrb w0, [x1, #22]
135 orr x12, x12, x0, lsl #48
136 ldrb w0, [x1, #23]
137 orr x12, x12, x0, lsl #56
138 ldrb w13, [x1, #24]
139 ldrb w0, [x1, #25]
140 orr x13, x13, x0, lsl #8
141 ldrb w0, [x1, #26]
142 orr x13, x13, x0, lsl #16
143 ldrb w0, [x1, #27]
144 orr x13, x13, x0, lsl #24
145 ldrb w0, [x1, #28]
146 orr x13, x13, x0, lsl #32
147 ldrb w0, [x1, #29]
148 orr x13, x13, x0, lsl #40
149 ldrb w0, [x1, #30]
150 orr x13, x13, x0, lsl #48
151 ldrb w0, [x1, #31]
152 orr x13, x13, x0, lsl #56
153 orr x13, x13, #0x4000000000000000
154 stp x12, x13, [scalar+16]
155
156 // Discard the MSB of the point X coordinate (this is in
157 // accordance with the RFC, mod 2^255, *not* 2^255-19).
158 // Then recode it into the unsaturated base 25.5 form.
159
160 ldrb w4, [x2]
161 ldrb w0, [x2, #1]
162 orr x4, x4, x0, lsl #8
163 ldrb w0, [x2, #2]
164 orr x4, x4, x0, lsl #16
165 ldrb w0, [x2, #3]
166 orr x4, x4, x0, lsl #24
167 ldrb w0, [x2, #4]
168 orr x4, x4, x0, lsl #32
169 ldrb w0, [x2, #5]
170 orr x4, x4, x0, lsl #40
171 ldrb w0, [x2, #6]
172 orr x4, x4, x0, lsl #48
173 ldrb w0, [x2, #7]
174 orr x4, x4, x0, lsl #56
175 ldrb w5, [x2, #8]
176 ldrb w0, [x2, #9]
177 orr x5, x5, x0, lsl #8
178 ldrb w0, [x2, #10]
179 orr x5, x5, x0, lsl #16
180 ldrb w0, [x2, #11]
181 orr x5, x5, x0, lsl #24
182 ldrb w0, [x2, #12]
183 orr x5, x5, x0, lsl #32
184 ldrb w0, [x2, #13]
185 orr x5, x5, x0, lsl #40
186 ldrb w0, [x2, #14]
187 orr x5, x5, x0, lsl #48
188 ldrb w0, [x2, #15]
189 orr x5, x5, x0, lsl #56
190
191 ldrb w6, [x2, #16]
192 ldrb w0, [x2, #17]
193 orr x6, x6, x0, lsl #8
194 ldrb w0, [x2, #18]
195 orr x6, x6, x0, lsl #16
196 ldrb w0, [x2, #19]
197 orr x6, x6, x0, lsl #24
198 ldrb w0, [x2, #20]
199 orr x6, x6, x0, lsl #32
200 ldrb w0, [x2, #21]
201 orr x6, x6, x0, lsl #40
202 ldrb w0, [x2, #22]
203 orr x6, x6, x0, lsl #48
204 ldrb w0, [x2, #23]
205 orr x6, x6, x0, lsl #56
206 ldrb w7, [x2, #24]
207 ldrb w0, [x2, #25]
208 orr x7, x7, x0, lsl #8
209 ldrb w0, [x2, #26]
210 orr x7, x7, x0, lsl #16
211 ldrb w0, [x2, #27]
212 orr x7, x7, x0, lsl #24
213 ldrb w0, [x2, #28]
214 orr x7, x7, x0, lsl #32
215 ldrb w0, [x2, #29]
216 orr x7, x7, x0, lsl #40
217 ldrb w0, [x2, #30]
218 orr x7, x7, x0, lsl #48
219 ldrb w0, [x2, #31]
220 orr x7, x7, x0, lsl #56
221
222 lsr x12, x4, #51
223 lsr x17, x6, #51
224 orr x12, x12, x5, lsl #13
225 orr x17, x17, x7, lsl #13
226 ubfx x8, x7, #12, #26
227 ubfx x9, x7, #38, #25
228 ubfx x11, x4, #26, #25
229 ubfx x13, x5, #13, #25
230 lsr x14, x5, #38
231 ubfx x16, x6, #25, #26
232 and x10, x4, #0x3ffffff
233 and x12, x12, #0x3ffffff
234 and x15, x6, #0x1ffffff
235 and x17, x17, #0x1ffffff
236 orr x10, x10, x11, lsl #32
237 orr x11, x12, x13, lsl #32
238 orr x12, x14, x15, lsl #32
239 orr x13, x16, x17, lsl #32
240 orr x14, x8, x9, lsl #32
241
242 stp x10, x11, [pointx+0]
243 stp x12, x13, [pointx+16]
244 str x14, [pointx+32]
245
246 // Initialize (X2,Z2) = (1,0), the identity (projective point at infinity)
247
248 mov x1, #1
249 mov v0.d[0], x1
250 mov v2.d[0], xzr
251 mov v4.d[0], xzr
252 mov v6.d[0], xzr
253 mov v8.d[0], xzr
254
255 mov v1.d[0], xzr
256 mov v3.d[0], xzr
257 mov v5.d[0], xzr
258 mov v7.d[0], xzr
259 mov v9.d[0], xzr
260
261 // Initialize (X3,Z3) = (X,1), projective representation of X
262
263 mov v10.d[0], x10
264 mov v12.d[0], x11
265 mov v14.d[0], x12
266 mov v16.d[0], x13
267 mov v18.d[0], x14
268
269 mov v11.d[0], x1
270 mov v13.d[0], xzr
271 mov v15.d[0], xzr
272 mov v17.d[0], xzr
273 mov v19.d[0], xzr
274
275 // Set up some constants used repeatedly in the main loop:
276 //
277 // Q31 = 0x1300000013 (two 32-bit copies of 19)
278 // Q30 = 0x3ffffff0000000003ffffff (two 64-bit copies of 2^26-1)
279 // Q29 = mask1 = (0x07ffffc,0x07fffffe)
280 // Q28 = mask2 = (0x07ffffb4,0x07fffffe)
281
282 mov w0, #19
283 add x0, x0, x0, lsl #32
284 mov v31.d[0], x0
285 mov v31.d[1], xzr
286
287 mov x0, #67108863 // #(1<<26)-1
288 mov v30.d[0], x0
289 mov v30.d[1], x0
290
291 mov x0, #0x07fffffe07fffffe
292 sub x1, x0, #74 // #0xfe-0xb4
293 sub x0, x0, #2
294
295 stp x0, x1, [mask1]
296 ldp d29, d28, [mask1]
297
298 // The main loop over (modified) bits from i = 254, ..., i = 0 (inclusive);
299 // we explicitly skip bit 255 because it should be forced to zero initially.
300 // This is a classic Montgomery ladder using a "swap" variable.
301 // It's assumed x0 = i at the start of the loop, but that is volatile and
302 // needs to be reloaded from memory at the end of the loop.
303
304 str xzr, [swap]
305 mov x0, #254
306 str x0, [i]
307
308 curve25519_x25519_byte_scalarloop:
309
310 lsr x1, x0, #6
311 ldr x2, [sp, x1, lsl #3] // Exploiting scalar = sp exactly
312 lsr x2, x2, x0
313 and x2, x2, #1
314
315 ldr x0, [swap]
316 cmp x0, x2
317 str x2, [swap]
318
319 // The following inner loop code is derived closely following Lenngren's
320 // implementation available at "https://github.com/Emill/X25519-AArch64".
321 // In particular, the basic dataflow and the organization between integer
322 // and SIMD units is identical, with only a few minor changes to some
323 // individual instructions (for miscellaneous reasons). The scheduling
324 // was redone from scratch by SLOTHY starting from the un-interleaved
325 // form in the SLOTHY work cited above, and using the same scripts.
326 //
327 // The intermediate value annotations were added to provide data that
328 // is used in the formal proof, indicating which lines assign specific
329 // digits of the various intermediate results (mainly of field
330 // operations, sometimes other transformations). The names used for
331 // the intermediate results are similar but not identical to those in
332 // the abstract Algorithm 1 description in Lenngren's paper. Almost
333 // all equations are to be interpreted as field operations, i.e. as
334 // arithmetic modulo 2^255-19, not simple numeric equalities.
335 //
336 // b = x2 - z2
337 // d = x3 - z3
338 // a = x2 + z2
339 // c = x3 + z3
340 // f = if flip then c else a
341 // g = if flip then d else b
342 // aa = f^2
343 // bb = g^2
344 // bbalt = bb (change of representation)
345 // e = aa - bb
346 // bce = bbalt + 121666 * e
347 // z4 = bce * e
348 // bc = b * c
349 // ad = a * d
350 // t1 = ad + bc
351 // t2 = ad - bc
352 // x5 = t1^2
353 // t3 = t2^2
354 // x4 = aa * bb
355 // z5 = x * t3
356 //
357 // Then the main variables are updated for the next iteration as
358 //
359 // (x2',z2') = (x4,z4)
360 // (x3',z3') = (x5,z5)
361
362 add v22.2s, v2.2s, v3.2s // ubignum_of_qreglist 1 // INTERMEDIATE a
363 sub v21.2s, v28.2s, v1.2s
364 add v25.2s, v0.2s, v1.2s // ubignum_of_qreglist 0 // INTERMEDIATE a
365 sub v24.2s, v29.2s, v3.2s
366 add v3.2s, v18.2s, v19.2s // ubignum_of_qreglist 4 // INTERMEDIATE c
367 add v0.2s, v0.2s, v21.2s // ubignum_of_qreglist 0 // INTERMEDIATE b
368 sub v20.2s, v29.2s, v15.2s
369 sub v1.2s, v29.2s, v5.2s
370 sub v26.2s, v28.2s, v11.2s
371 sub v21.2s, v29.2s, v19.2s
372 add v19.2s, v10.2s, v11.2s // ubignum_of_qreglist 0 // INTERMEDIATE c
373 add v11.2s, v14.2s, v20.2s // ubignum_of_qreglist 2 // INTERMEDIATE d
374 add v21.2s, v18.2s, v21.2s // ubignum_of_qreglist 4 // INTERMEDIATE d
375 sub v20.2s, v29.2s, v17.2s
376 add v18.2s, v2.2s, v24.2s // ubignum_of_qreglist 1 // INTERMEDIATE b
377 add v14.2s, v14.2s, v15.2s // ubignum_of_qreglist 2 // INTERMEDIATE c
378 add v15.2s, v16.2s, v17.2s // ubignum_of_qreglist 3 // INTERMEDIATE c
379 add v2.2s, v16.2s, v20.2s // ubignum_of_qreglist 3 // INTERMEDIATE d
380 add v24.2s, v12.2s, v13.2s // ubignum_of_qreglist 1 // INTERMEDIATE c
381 add v26.2s, v10.2s, v26.2s // ubignum_of_qreglist 0 // INTERMEDIATE d
382 sub v10.2s, v29.2s, v13.2s
383 sub v13.2s, v29.2s, v7.2s
384 add v23.2s, v6.2s, v7.2s // ubignum_of_qreglist 3 // INTERMEDIATE a
385 sub v7.2s, v29.2s, v9.2s
386 add v27.2s, v12.2s, v10.2s // ubignum_of_qreglist 1 // INTERMEDIATE d
387 fcsel d20, d22, d24, eq // ubignum_of_qreglist 1 // INTERMEDIATE f
388 add v28.2s, v4.2s, v5.2s // ubignum_of_qreglist 2 // INTERMEDIATE a
389 fcsel d12, d23, d15, eq // ubignum_of_qreglist 3 // INTERMEDIATE f
390 add v7.2s, v8.2s, v7.2s // ubignum_of_qreglist 4 // INTERMEDIATE b
391 fcsel d16, d25, d19, eq // ubignum_of_qreglist 0 // INTERMEDIATE f
392 mov x0, v20.d[0]
393 fcsel d5, d28, d14, eq // ubignum_of_qreglist 2 // INTERMEDIATE f
394 mov x21, v12.d[0]
395 fcsel d29, d7, d21, eq // ubignum_of_qreglist 4 // INTERMEDIATE g
396 mov x5, v16.d[0]
397 lsr x26, x0, #32
398 add x29, x21, x21
399 umull x15, w5, w29
400 add v13.2s, v6.2s, v13.2s // ubignum_of_qreglist 3 // INTERMEDIATE b
401 add x12, x26, x26
402 mov x30, v5.d[0]
403 fcsel d10, d18, d27, eq // ubignum_of_qreglist 1 // INTERMEDIATE g
404 lsr x11, x5, #32
405 lsr x10, x30, #32
406 trn2 v20.2s, v21.2s, v3.2s
407 add v9.2s, v8.2s, v9.2s // ubignum_of_qreglist 4 // INTERMEDIATE a
408 add x14, x11, x11
409 trn2 v6.2s, v2.2s, v15.2s
410 trn1 v12.2s, v25.2s, v0.2s
411 add v1.2s, v4.2s, v1.2s // ubignum_of_qreglist 2 // INTERMEDIATE b
412 trn1 v16.2s, v23.2s, v13.2s
413 fcsel d8, d13, d2, eq // ubignum_of_qreglist 3 // INTERMEDIATE g
414 trn2 v17.2s, v27.2s, v24.2s
415 str d29, [tmpb+32]
416 add x17, x10, x10
417 trn2 v4.2s, v28.2s, v1.2s
418 trn1 v5.2s, v28.2s, v1.2s
419 trn1 v28.2s, v2.2s, v15.2s
420 trn1 v2.2s, v22.2s, v18.2s
421 fcsel d29, d0, d26, eq // ubignum_of_qreglist 0 // INTERMEDIATE g
422 trn2 v15.2s, v22.2s, v18.2s
423 umull v22.2d, v12.2s, v20.2s
424 umull x22, w30, w17
425 stp d29, d10, [tmpb+0]
426 trn2 v10.2s, v23.2s, v13.2s
427 trn2 v23.2s, v11.2s, v14.2s
428 trn1 v13.2s, v27.2s, v24.2s
429 fcsel d27, d1, d11, eq // ubignum_of_qreglist 2 // INTERMEDIATE g
430 trn1 v14.2s, v11.2s, v14.2s
431 umlal v22.2d, v2.2s, v6.2s
432 umull x25, w30, w30
433 umlal v22.2d, v5.2s, v23.2s
434 add x3, x30, x30
435 umlal v22.2d, v16.2s, v17.2s
436 add w30, w21, w21, lsl #1;
437 stp d27, d8, [tmpb+16]
438 add w30, w30, w21, lsl #4
439 trn1 v11.2s, v26.2s, v19.2s
440 trn2 v8.2s, v26.2s, v19.2s
441 trn2 v19.2s, v25.2s, v0.2s
442 mul v29.2s, v20.2s, v31.2s
443 ldr x20, [tmpb+24]
444 umull v25.2d, v19.2s, v6.2s
445 add x1, x0, x0
446 umull v27.2d, v19.2s, v23.2s
447 umull x9, w5, w1
448 umull v0.2d, v12.2s, v23.2s
449 lsr x24, x20, #32
450 mul v20.2s, v23.2s, v31.2s
451 lsr x16, x21, #32
452 umlal v25.2d, v15.2s, v23.2s
453 umaddl x13, w11, w14, x9
454 umlal v25.2d, v4.2s, v17.2s
455 umaddl x9, w14, w17, x15
456 umull v24.2d, v12.2s, v6.2s
457 add w2, w16, w16, lsl #1;
458 fcsel d26, d9, d3, eq // ubignum_of_qreglist 4 // INTERMEDIATE f
459 add w2, w2, w16, lsl #4
460 trn1 v18.2s, v21.2s, v3.2s
461 umull v3.2d, v19.2s, v29.2s
462 umull x28, w5, w3
463 mul v1.2s, v6.2s, v31.2s
464 umull x8, w5, w5
465 umlal v24.2d, v2.2s, v23.2s
466 umaddl x13, w21, w30, x13
467 mul v23.2s, v17.2s, v31.2s
468 umaddl x27, w14, w12, x28
469 trn2 v6.2s, v9.2s, v7.2s
470 mov x6, v26.d[0]
471 umlal v3.2d, v15.2s, v1.2s
472 add x16, x16, x16
473 umlal v3.2d, v4.2s, v20.2s
474 lsr x4, x6, #32
475 umlal v3.2d, v10.2s, v23.2s
476 add x7, x6, x6
477 umull v26.2d, v19.2s, v8.2s
478 add x23, x4, x4
479 umaddl x28, w5, w23, x22
480 trn1 v7.2s, v9.2s, v7.2s
481 umlal v27.2d, v15.2s, v17.2s
482 add w15, w4, w4, lsl #1;
483 umlal v27.2d, v4.2s, v8.2s
484 add w15, w15, w4, lsl #4
485 add w22, w10, w10, lsl #1;
486 umlal v24.2d, v5.2s, v17.2s
487 add w22, w22, w10, lsl #4
488 umaddl x10, w11, w7, x28
489 umlal v25.2d, v10.2s, v8.2s
490 umull x21, w5, w16
491 umlal v25.2d, v6.2s, v29.2s
492 umaddl x23, w15, w23, x25
493 umlal v27.2d, v10.2s, v29.2s
494 umull x19, w5, w12
495 umlal v27.2d, v6.2s, v1.2s
496 umaddl x25, w11, w29, x21
497 umlal v0.2d, v2.2s, v17.2s
498 umaddl x28, w0, w3, x9
499 shl v21.2d, v25.2d, #1
500 umaddl x4, w11, w1, x19
501 umaddl x21, w2, w29, x4
502 mul v25.2s, v8.2s, v31.2s
503 umlal v24.2d, v16.2s, v8.2s
504 umaddl x19, w0, w17, x25
505 umlal v24.2d, v7.2s, v29.2s
506 umull x25, w5, w17
507 umlal v24.2d, v19.2s, v28.2s
508 umaddl x4, w0, w16, x10
509 umull v9.2d, v12.2s, v8.2s
510 umaddl x23, w5, w7, x23
511 umlal v21.2d, v12.2s, v18.2s
512 add w10, w6, w6, lsl #1;
513 shl v27.2d, v27.2d, #1
514 add w10, w10, w6, lsl #4
515 umaddl x28, w26, w12, x28
516 umlal v26.2d, v15.2s, v29.2s
517 umaddl x9, w14, w16, x23
518 umlal v9.2d, v2.2s, v29.2s
519 umaddl x22, w22, w17, x8
520 umlal v21.2d, v2.2s, v28.2s
521 umaddl x28, w6, w10, x28
522 umaddl x27, w0, w0, x27
523 add x8, x14, x14
524 umlal v0.2d, v5.2s, v8.2s
525 umull x5, w5, w14
526 umlal v9.2d, v5.2s, v1.2s
527 umaddl x14, w0, w29, x9
528 umlal v26.2d, v4.2s, v1.2s
529 umaddl x6, w2, w16, x27
530 umlal v22.2d, v7.2s, v8.2s
531 umaddl x5, w30, w17, x5
532 umaddl x5, w2, w3, x5
533 add x23, x17, x17
534 umlal v27.2d, v12.2s, v28.2s
535 umaddl x13, w2, w23, x13
536 umlal v26.2d, v10.2s, v20.2s
537 add x9, x12, x12
538 umlal v9.2d, v16.2s, v20.2s
539 umaddl x27, w10, w29, x6
540 umlal v0.2d, v16.2s, v29.2s
541 umaddl x6, w11, w3, x25
542 umlal v22.2d, v19.2s, v18.2s
543 umaddl x19, w26, w3, x19
544 mul v18.2s, v18.2s, v31.2s
545 umaddl x23, w15, w23, x27
546 umlal v3.2d, v6.2s, v25.2s
547 umaddl x0, w0, w12, x6
548 umlal v0.2d, v7.2s, v1.2s
549 add x11, x16, x16
550 umlal v9.2d, v7.2s, v23.2s
551 umaddl x6, w12, w17, x14
552 umlal v9.2d, v19.2s, v11.2s
553 umaddl x25, w26, w29, x4
554 umlal v9.2d, v15.2s, v18.2s
555 umaddl x14, w10, w3, x13
556 umull v25.2d, v12.2s, v17.2s
557 umaddl x27, w10, w16, x0
558 umlal v26.2d, v6.2s, v23.2s
559 add x0, x25, x6, lsr #26
560 mul v23.2s, v28.2s, v31.2s
561 umaddl x12, w10, w12, x5
562 shl v3.2d, v3.2d, #1
563 add x16, x22, x0, lsr #25
564 umlal v21.2d, v5.2s, v14.2s
565 bic x22, x0, #0x1ffffff
566 umlal v3.2d, v12.2s, v11.2s
567 add x26, x16, x22, lsr #24
568 umlal v3.2d, v2.2s, v18.2s
569 umaddl x16, w10, w17, x21
570 umlal v3.2d, v5.2s, v23.2s
571 add x22, x26, x22, lsr #21
572 umlal v9.2d, v4.2s, v23.2s
573 umaddl x5, w15, w29, x27
574 umull v17.2d, v19.2s, v17.2s
575 umaddl x17, w30, w3, x22
576 umlal v25.2d, v2.2s, v8.2s
577 umaddl x25, w15, w3, x16
578 umlal v25.2d, v5.2s, v29.2s
579 umaddl x26, w15, w7, x19
580 umlal v0.2d, v19.2s, v14.2s
581 umaddl x17, w2, w9, x17
582 umlal v17.2d, v15.2s, v8.2s
583 ldr x19, [tmpb+0]
584 umlal v17.2d, v4.2s, v29.2s
585 ldr x7, [tmpb+8]
586 shl v29.2d, v26.2d, #1
587 umaddl x13, w10, w1, x17
588 umlal v0.2d, v15.2s, v13.2s
589 lsr x2, x19, #32
590 umlal v29.2d, v12.2s, v13.2s
591 umaddl x27, w15, w1, x12
592 umlal v29.2d, v2.2s, v11.2s
593 umaddl x30, w15, w8, x13
594 umlal v29.2d, v5.2s, v18.2s
595 add x4, x7, x7
596 umlal v29.2d, v16.2s, v23.2s
597 umaddl x29, w15, w9, x14
598 umlal v0.2d, v4.2s, v11.2s
599 add x17, x27, x30, lsr #26
600 umlal v0.2d, v10.2s, v18.2s
601 umaddl x16, w15, w11, x28
602 umlal v0.2d, v6.2s, v23.2s
603 add x1, x29, x17, lsr #25
604 umlal v25.2d, v16.2s, v1.2s
605 umull x11, w19, w4
606 ldr x8, [tmpb+32]
607 mul v26.2s, v14.2s, v31.2s
608 umlal v17.2d, v10.2s, v1.2s
609 ldr x15, [tmpb+16]
610 umlal v17.2d, v6.2s, v20.2s
611 and x9, x30, #0x3ffffff
612 bfi x9, x17, #32, #25 // ubignum_of_preglist 0 // INTERMEDIATE aa
613 add x17, x2, x2
614 lsr x10, x15, #32
615 add x27, x25, x1, lsr #26
616 umlal v25.2d, v7.2s, v20.2s
617 add x13, x10, x10
618 umlal v25.2d, v19.2s, v13.2s
619 add x29, x23, x27, lsr #25
620 umlal v25.2d, v15.2s, v11.2s
621 lsr x30, x8, #32
622 umlal v25.2d, v4.2s, v18.2s
623 add x23, x5, x29, lsr #26
624 umlal v25.2d, v10.2s, v23.2s
625 and x14, x29, #0x3ffffff
626 umlal v25.2d, v6.2s, v26.2s
627 add x5, x16, x23, lsr #25
628 shl v8.2d, v17.2d, #1
629 umaddl x12, w2, w17, x11
630 and x29, x5, #0x3ffffff
631 umull x21, w19, w19
632 umlal v29.2d, v7.2s, v26.2s
633 add w16, w10, w10, lsl #1;
634 umlal v3.2d, v16.2s, v26.2s
635 add w16, w16, w10, lsl #4
636 bfi x14, x23, #32, #25 // ubignum_of_preglist 2 // INTERMEDIATE aa
637 add w10, w24, w24, lsl #1;
638 add x22, x26, x5, lsr #26
639 add w10, w10, w24, lsl #4
640 umlal v8.2d, v12.2s, v14.2s
641 umaddl x25, w16, w13, x21
642 umlal v8.2d, v2.2s, v13.2s
643 bfi x29, x22, #32, #25 // ubignum_of_preglist 3 // INTERMEDIATE aa
644 umlal v8.2d, v5.2s, v11.2s
645 add x26, x24, x24
646 umlal v8.2d, v16.2s, v18.2s
647 stp x14, x29, [tmpa+16]
648 umlal v8.2d, v7.2s, v23.2s
649 add w24, w30, w30, lsl #1;
650 usra v25.2d, v29.2d, #26
651 add w24, w24, w30, lsl #4
652 umull x29, w15, w15
653 umlal v27.2d, v2.2s, v14.2s
654 umull x3, w15, w13
655 umlal v27.2d, v5.2s, v13.2s
656 add x21, x20, x20
657 umlal v24.2d, v15.2s, v14.2s
658 umull x5, w19, w21
659 umlal v24.2d, v4.2s, v13.2s
660 and x11, x1, #0x3ffffff
661 usra v8.2d, v25.2d, #25
662 and x1, x0, #0x1ffffff
663 umlal v27.2d, v16.2s, v11.2s
664 umaddl x23, w17, w13, x5
665 umlal v27.2d, v7.2s, v18.2s
666 add x5, x30, x30
667 usra v0.2d, v8.2d, #26
668 add x0, x15, x15
669 umlal v24.2d, v10.2s, v11.2s
670 umaddl x23, w7, w0, x23
671 umlal v24.2d, v6.2s, v18.2s
672 lsr x30, x7, #32
673 usra v27.2d, v0.2d, #25
674 add x16, x30, x30
675 and v20.16b, v8.16b, v30.16b // ubignum_of_hreglist 4 + ubignum_of_lreglist 4 // INTERMEDIATE H|L = bc|ad
676 umaddl x15, w30, w16, x23
677 ushr v23.2d, v30.2d, #1
678 add w23, w8, w8, lsl #1;
679 usra v24.2d, v27.2d, #26
680 add w23, w23, w8, lsl #4
681 umaddl x14, w19, w5, x3
682 and v8.16b, v27.16b, v30.16b // ubignum_of_hreglist 6 + ubignum_of_lreglist 6 // INTERMEDIATE H|L = bc|ad
683 add x28, x8, x8
684 and v27.16b, v0.16b, v23.16b // ubignum_of_hreglist 5 + ubignum_of_lreglist 5 // INTERMEDIATE H|L = bc|ad
685 umaddl x8, w8, w23, x15
686 and v5.16b, v24.16b, v23.16b // ubignum_of_hreglist 7 + ubignum_of_lreglist 7 // INTERMEDIATE H|L = bc|ad
687 umaddl x3, w2, w28, x14
688 umlal v22.2d, v15.2s, v28.2s
689 bfi x11, x27, #32, #25 // ubignum_of_preglist 1 // INTERMEDIATE aa
690 uzp1 v5.4s, v8.4s, v5.4s
691 umaddl x14, w24, w5, x29
692 umaddl x5, w19, w28, x14
693 ldr d18, [mask1]
694 mov v18.d[1], v18.d[0]
695 umaddl x15, w7, w26, x3
696 mul v12.2s, v13.2s, v31.2s
697 umlal v21.2d, v16.2s, v13.2s
698 stp x9, x11, [tmpa+0]
699 umlal v21.2d, v7.2s, v11.2s
700 umaddl x29, w17, w26, x5
701 umlal v22.2d, v4.2s, v14.2s
702 add w14, w20, w20, lsl #1;
703 umlal v22.2d, v10.2s, v13.2s
704 add w14, w14, w20, lsl #4
705 umull x3, w19, w0
706 umlal v22.2d, v6.2s, v11.2s
707 umaddl x29, w7, w21, x29
708 usra v21.2d, v24.2d, #25
709 umaddl x11, w20, w14, x12
710 and v0.16b, v25.16b, v23.16b
711 umaddl x5, w30, w21, x15
712 and v14.16b, v29.16b, v30.16b
713 umaddl x12, w16, w13, x29
714 usra v22.2d, v21.2d, #26
715 umaddl x29, w17, w16, x3
716 umlal v3.2d, v7.2s, v12.2s
717 add x9, x26, x26
718 and v1.16b, v21.16b, v30.16b // ubignum_of_hreglist 8 + ubignum_of_lreglist 8 // INTERMEDIATE H|L = bc|ad
719 add x27, x5, x12, lsr #26
720 bic v8.16b, v22.16b, v23.16b
721 umaddl x29, w7, w7, x29
722 and v17.16b, v22.16b, v23.16b // ubignum_of_hreglist 9 + ubignum_of_lreglist 9 // INTERMEDIATE H|L = bc|ad
723 add x5, x25, x27, lsr #25
724 usra v3.2d, v8.2d, #25
725 umaddl x25, w24, w9, x8
726 umlal v9.2d, v10.2s, v26.2s
727 add x8, x13, x13
728 trn1 v22.4s, v1.4s, v17.4s
729 umaddl x11, w10, w8, x11
730 usra v3.2d, v8.2d, #24
731 umull x20, w19, w16
732 add v26.2s, v22.2s, v18.2s
733 ldr d28, [mask2]
734 umlal v9.2d, v6.2s, v12.2s
735 umaddl x3, w23, w0, x11
736 usra v3.2d, v8.2d, #21
737 umaddl x29, w10, w26, x29
738 uzp1 v11.4s, v20.4s, v27.4s
739 umaddl x20, w2, w4, x20
740 umaddl x9, w10, w21, x20
741 mov v17.d[0], v22.d[1]
742 usra v9.2d, v3.2d, #26
743 umull x15, w19, w13
744 and v7.16b, v3.16b, v30.16b // ubignum_of_hreglist 0 + ubignum_of_lreglist 0 // INTERMEDIATE H|L = bc|ad
745 add x11, x16, x16
746 uzp2 v1.4s, v11.4s, v5.4s
747 umaddl x20, w23, w13, x9
748 and v8.16b, v9.16b, v23.16b // ubignum_of_hreglist 1 + ubignum_of_lreglist 1 // INTERMEDIATE H|L = bc|ad
749 umaddl x9, w2, w0, x15
750 usra v14.2d, v9.2d, #25
751 and x6, x6, #0x3ffffff
752 uzp1 v7.4s, v7.4s, v8.4s
753 umaddl x29, w23, w21, x29
754 uzp1 v27.4s, v11.4s, v5.4s
755 umull x15, w19, w26
756 usra v0.2d, v14.2d, #26 // ubignum_of_hreglist 3 + ubignum_of_lreglist 3 // INTERMEDIATE H|L = bc|ad
757 add x6, x6, x22, lsr #25
758 and v3.16b, v14.16b, v30.16b // ubignum_of_hreglist 2 + ubignum_of_lreglist 2 // INTERMEDIATE H|L = bc|ad
759 bic x22, x27, #0x1ffffff
760 sub v2.2s, v26.2s, v17.2s
761 add v9.2s, v22.2s, v17.2s
762 uzp1 v14.4s, v3.4s, v0.4s
763 umaddl x2, w2, w21, x15
764 add v5.4s, v27.4s, v18.4s
765 add x5, x5, x22, lsr #24
766 zip1 v22.2s, v2.2s, v9.2s // ubignum_of_h32reglist 8 + ubignum_of_l32reglist 8 // INTERMEDIATE H|L = t1|t2
767 mov v18.b[0], v28.b[0]
768 uzp1 v8.4s, v7.4s, v14.4s
769 add x22, x5, x22, lsr #21
770 uzp2 v3.4s, v7.4s, v14.4s
771 umaddl x5, w7, w16, x9
772 add v25.4s, v8.4s, v18.4s
773 umaddl x15, w14, w0, x22
774 add v12.4s, v27.4s, v1.4s
775 add x9, x17, x17
776 sub v14.4s, v5.4s, v1.4s
777 umull x19, w19, w17
778 sub v18.4s, v25.4s, v3.4s
779 ldr x22, [tmpa+8]
780 add v20.4s, v8.4s, v3.4s
781 umaddl x15, w10, w11, x15
782 zip1 v16.4s, v14.4s, v12.4s // ubignum_of_h32reglist 4 + ubignum_of_l32reglist 4 // INTERMEDIATE H|L = t1|t2
783 umaddl x14, w14, w13, x19
784 zip2 v14.4s, v14.4s, v12.4s // ubignum_of_h32reglist 6 + ubignum_of_l32reglist 6 // INTERMEDIATE H|L = t1|t2
785 and x17, x27, #0x1ffffff
786 zip2 v0.4s, v18.4s, v20.4s // ubignum_of_h32reglist 2 + ubignum_of_l32reglist 2 // INTERMEDIATE H|L = t1|t2
787 umaddl x15, w23, w4, x15
788 zip1 v1.4s, v18.4s, v20.4s // ubignum_of_h32reglist 0 + ubignum_of_l32reglist 0 // INTERMEDIATE H|L = t1|t2
789 umaddl x10, w10, w0, x14
790 zip2 v5.2s, v2.2s, v9.2s // ubignum_of_h32reglist 9 + ubignum_of_l32reglist 9 // INTERMEDIATE H|L = t1|t2
791 shl v24.2s, v0.2s, #1
792 mov v19.d[0], v1.d[1] // ubignum_of_h32reglist 1 + ubignum_of_l32reglist 1 // INTERMEDIATE H|L = t1|t2
793 shl v26.2s, v22.2s, #1
794 shl v17.2s, v16.2s, #1
795 mov v15.d[0], v0.d[1] // ubignum_of_h32reglist 3 + ubignum_of_l32reglist 3 // INTERMEDIATE H|L = t1|t2
796 shl v7.2s, v5.2s, #1
797 shl v18.2s, v19.2s, #1
798 umull v11.2d, v1.2s, v24.2s
799 umaddl x19, w23, w16, x10
800 umull v6.2d, v1.2s, v17.2s
801 umaddl x10, w7, w13, x2
802 mov v4.d[0], v16.d[1] // ubignum_of_h32reglist 5 + ubignum_of_l32reglist 5 // INTERMEDIATE H|L = t1|t2
803 mov v10.d[0], v14.d[1] // ubignum_of_h32reglist 7 + ubignum_of_l32reglist 7 // INTERMEDIATE H|L = t1|t2
804 umull v9.2d, v1.2s, v26.2s
805 ldr x13, [tmpa+0]
806 shl v28.2s, v15.2s, #1
807 shl v3.2s, v10.2s, #1
808 ldr x14, [tmpa+16]
809 mul v12.2s, v10.2s, v31.2s
810 umull v25.2d, v1.2s, v7.2s
811 ldr x2, [tmpa+24]
812 umlal v6.2d, v18.2s, v28.2s
813 umaddl x27, w30, w0, x10
814 umaddl x16, w24, w0, x20
815 shl v13.2s, v14.2s, #1
816 umaddl x5, w23, w26, x5
817 mul v2.2s, v22.2s, v31.2s
818 umull v21.2d, v1.2s, v13.2s
819 umaddl x23, w24, w8, x29
820 umlal v11.2d, v18.2s, v19.2s
821 mov x10, #0x07fffffe07fffffe
822 sub x10, x10, #2
823 umaddl x26, w24, w21, x5
824 mul v29.2s, v14.2s, v31.2s
825 umlal v25.2d, v19.2s, v26.2s
826 add x7, x1, x6, lsr #26
827 mul v20.2s, v4.2s, v31.2s
828 and x6, x6, #0x3ffffff
829 shl v8.2s, v18.2s, #1
830 shl v4.2s, v4.2s, #1
831 umlal v11.2d, v29.2s, v14.2s
832 bfi x6, x7, #32, #26 // ubignum_of_preglist 4 // INTERMEDIATE aa
833 umlal v25.2d, v0.2s, v3.2s
834 umaddl x0, w24, w4, x19
835 umlal v25.2d, v15.2s, v13.2s
836 str x6, [tmpa+32]
837 umlal v21.2d, v18.2s, v4.2s
838 umaddl x8, w24, w11, x3
839 umlal v21.2d, v0.2s, v17.2s
840 ldr x30, [tmpa+32]
841 mul v14.2s, v5.2s, v31.2s
842 add x2, x2, x10
843 shl v5.2s, v28.2s, #1
844 shl v27.2s, v4.2s, #1
845 umlal v6.2d, v0.2s, v0.2s
846 umaddl x11, w24, w9, x15
847 umlal v6.2d, v12.2s, v3.2s
848 add x4, x30, x10
849 umlal v11.2d, v14.2s, v5.2s
850 add x3, x22, x10
851 umlal v11.2d, v2.2s, v17.2s
852 add x6, x0, x11, lsr #26
853 umlal v11.2d, v12.2s, v27.2s
854 add x14, x14, x10
855 umlal v6.2d, v14.2s, v27.2s
856 add x8, x8, x6, lsr #25
857 umlal v6.2d, v2.2s, v13.2s
858 movk x10, #0xffb4
859 umlal v25.2d, v16.2s, v4.2s
860 add x29, x16, x8, lsr #26
861 umull v27.2d, v1.2s, v3.2s
862 and x11, x11, #0x3ffffff
863 umlal v9.2d, v18.2s, v3.2s
864 add x19, x13, x10
865 umlal v9.2d, v0.2s, v13.2s
866 and x5, x8, #0x3ffffff
867 umlal v9.2d, v28.2s, v4.2s
868 bfi x11, x6, #32, #25 // ubignum_of_preglist 0 // INTERMEDIATE bb
869 umlal v9.2d, v16.2s, v16.2s
870 umaddl x30, w24, w28, x27
871 umlal v9.2d, v14.2s, v7.2s
872 sub x13, x19, x11
873 umull v10.2d, v1.2s, v18.2s
874 add x7, x23, x29, lsr #25
875 umlal v21.2d, v28.2s, v15.2s
876 lsr x16, x13, #32 // ubignum_of_wreglist 1 + ubignum_of_wreglist 0 // INTERMEDIATE e
877 umlal v21.2d, v2.2s, v22.2s
878 add x0, x26, x7, lsr #26
879 usra v25.2d, v9.2d, #26
880 and x20, x7, #0x3ffffff
881 umull v22.2d, v1.2s, v1.2s
882 add x8, x25, x0, lsr #25
883 umull v7.2d, v1.2s, v28.2s
884 and x1, x29, #0x1ffffff // ubignum_of_xreglist 3 // INTERMEDIATE bbalt
885 bic v18.16b, v25.16b, v23.16b
886 and x19, x8, #0x3ffffff
887 and v16.16b, v9.16b, v30.16b
888 and x7, x12, #0x3ffffff
889 usra v22.2d, v18.2d, #25
890 add x10, x30, x8, lsr #26
891 umlal v7.2d, v19.2s, v24.2s
892 bfi x5, x29, #32, #25 // ubignum_of_preglist 1 // INTERMEDIATE bb
893 and v9.16b, v25.16b, v23.16b
894 add x27, x7, x10, lsr #25
895 usra v22.2d, v18.2d, #24
896 mov x21, #60833
897 lsl x21, x21, #1
898 add x15, x17, x27, lsr #26
899 shl v25.2s, v3.2s, #1
900 umlal v7.2d, v14.2s, v17.2s
901 and x29, x27, #0x3ffffff
902 usra v22.2d, v18.2d, #21
903 bfi x29, x15, #32, #26 // ubignum_of_preglist 4 // INTERMEDIATE bb // ***SOURCE*** ubignum_of_xreglist 9 // INTERMEDIATE bbalt
904 umlal v10.2d, v14.2s, v24.2s
905 and x17, x6, #0x1ffffff // ubignum_of_xreglist 1 // INTERMEDIATE bbalt
906 umlal v10.2d, v2.2s, v28.2s
907 sub x6, x3, x5
908 umlal v10.2d, v12.2s, v17.2s
909 umaddl x25, w16, w21, x17
910 umlal v10.2d, v29.2s, v4.2s
911 mov w12, w5 // ubignum_of_xreglist 2 // INTERMEDIATE bbalt
912 umlal v22.2d, v20.2s, v4.2s
913 lsr x26, x6, #32 // ubignum_of_wreglist 3 + ubignum_of_wreglist 2 // INTERMEDIATE e
914 umlal v22.2d, v14.2s, v8.2s
915 and x24, x0, #0x1ffffff // ubignum_of_xreglist 5 // INTERMEDIATE bbalt
916 umlal v22.2d, v2.2s, v24.2s
917 stp x11, x5, [tmpb+0]
918 umlal v22.2d, v12.2s, v5.2s
919 bfi x20, x0, #32, #25 // ubignum_of_preglist 2 // INTERMEDIATE bb
920 umlal v22.2d, v29.2s, v17.2s
921 umaddl x12, w6, w21, x12
922 umull v18.2d, v1.2s, v4.2s
923 bfi x19, x10, #32, #25 // ubignum_of_preglist 3 // INTERMEDIATE bb
924 umlal v7.2d, v2.2s, v4.2s
925 sub x7, x14, x20
926 umlal v27.2d, v19.2s, v13.2s
927 mov w8, w20 // ubignum_of_xreglist 4 // INTERMEDIATE bbalt
928 usra v10.2d, v22.2d, #26
929 lsr x14, x7, #32 // ubignum_of_wreglist 5 + ubignum_of_wreglist 4 // INTERMEDIATE e
930 umlal v18.2d, v19.2s, v17.2s
931 and x28, x10, #0x1ffffff // ubignum_of_xreglist 7 // INTERMEDIATE bbalt
932 umlal v7.2d, v12.2s, v13.2s
933 sub x5, x2, x19
934 usra v11.2d, v10.2d, #25
935 mov w2, w19 // ubignum_of_xreglist 6 // INTERMEDIATE bbalt
936 umlal v27.2d, v0.2s, v4.2s
937 umlal v21.2d, v14.2s, v25.2s
938 sub x23, x4, x29
939 usra v7.2d, v11.2d, #26
940 mov w0, w29 // ubignum_of_xreglist 8 // INTERMEDIATE bbalt
941 umlal v18.2d, v0.2s, v28.2s
942 lsr x22, x23, #32 // ubignum_of_wreglist 9 + ubignum_of_wreglist 8 // INTERMEDIATE e
943 umlal v27.2d, v15.2s, v17.2s
944 str x29, [tmpb+32]
945 usra v6.2d, v7.2d, #25
946 mov w17, w11 // ubignum_of_xreglist 0 // INTERMEDIATE bbalt
947 and v0.16b, v22.16b, v30.16b // ubignum_of_hreglist 0 + ubignum_of_lreglist 0 // INTERMEDIATE H|L = x5|t3
948 umaddl x27, w26, w21, x1
949 umlal v18.2d, v14.2s, v13.2s
950 umaddl x30, w23, w21, x0
951 umlal v18.2d, v2.2s, v3.2s
952 lsr x10, x5, #32 // ubignum_of_wreglist 7 + ubignum_of_wreglist 6 // INTERMEDIATE e
953 and v4.16b, v6.16b, v30.16b // ubignum_of_hreglist 4 + ubignum_of_lreglist 4 // INTERMEDIATE H|L = x5|t3
954 and v1.16b, v10.16b, v23.16b // ubignum_of_hreglist 1 + ubignum_of_lreglist 1 // INTERMEDIATE H|L = x5|t3
955 umaddl x4, w14, w21, x24
956 ldr x0, [tmpa+0]
957 mov v0.s[1], w0
958 lsr x0, x0, #32
959 mov v1.s[1], w0
960 umaddl x9, w7, w21, x8
961 usra v18.2d, v6.2d, #26
962 umaddl x24, w10, w21, x28
963 and v3.16b, v7.16b, v23.16b // ubignum_of_hreglist 3 + ubignum_of_lreglist 3 // INTERMEDIATE H|L = x5|t3
964 umaddl x8, w22, w21, x15
965 umlal v27.2d, v14.2s, v26.2s
966 umaddl x15, w13, w21, x17
967 usra v21.2d, v18.2d, #25
968 stp x20, x19, [tmpb+16]
969 and v2.16b, v11.16b, v30.16b // ubignum_of_hreglist 2 + ubignum_of_lreglist 2 // INTERMEDIATE H|L = x5|t3
970 lsr x29, x8, #25
971 ldr x3, [tmpb+0]
972 mov v10.s[1], w3
973 lsr x3, x3, #32
974 mov v11.s[1], w3
975 add x17, x15, x29
976 usra v27.2d, v21.2d, #26
977 add x28, x17, x29, lsl #1
978 and v6.16b, v21.16b, v30.16b // ubignum_of_hreglist 6 + ubignum_of_lreglist 6 // INTERMEDIATE H|L = x5|t3
979 and x20, x8, #0x1ffffff
980 and v5.16b, v18.16b, v23.16b // ubignum_of_hreglist 5 + ubignum_of_lreglist 5 // INTERMEDIATE H|L = x5|t3
981 add x17, x28, x29, lsl #4
982 and v7.16b, v27.16b, v23.16b // ubignum_of_hreglist 7 + ubignum_of_lreglist 7 // INTERMEDIATE H|L = x5|t3
983 ldr x3, [tmpb+8]
984 mov v22.s[1], w3
985 lsr x3, x3, #32
986 mov v23.s[1], w3
987 add x29, x25, x17, lsr #26
988 ldr x15, [pointx+0]
989 mov v10.s[0], w15
990 lsr x15, x15, #32
991 mov v11.s[0], w15
992 and x11, x17, #0x3ffffff // ubignum_of_xreglist 0 // INTERMEDIATE bce
993 usra v16.2d, v27.2d, #25
994 add x8, x12, x29, lsr #25
995 ldr x3, [tmpb+16]
996 mov v14.s[1], w3
997 lsr x3, x3, #32
998 mov v15.s[1], w3
999 and x12, x29, #0x1ffffff // ubignum_of_xreglist 1 // INTERMEDIATE bce
1000 ldr x15, [pointx+8]
1001 mov v22.s[0], w15
1002 lsr x15, x15, #32
1003 mov v23.s[0], w15
1004 add x28, x27, x8, lsr #26
1005 and v8.16b, v16.16b, v30.16b // ubignum_of_hreglist 8 + ubignum_of_lreglist 8 // INTERMEDIATE H|L = x5|t3
1006 umull x1, w12, w10
1007 ldr x3, [tmpb+24]
1008 mov v17.s[1], w3
1009 lsr x3, x3, #32
1010 mov v18.s[1], w3
1011 add x25, x9, x28, lsr #25
1012 ldr x15, [pointx+16]
1013 mov v14.s[0], w15
1014 lsr x15, x15, #32
1015 mov v15.s[0], w15
1016 umaddl x19, w5, w21, x2
1017 usra v9.2d, v16.2d, #26 // ubignum_of_hreglist 8 + ubignum_of_lreglist 8 // INTERMEDIATE H|L = x5|t3
1018 add x2, x4, x25, lsr #26
1019 ldr x3, [tmpb+32]
1020 mov v24.s[1], w3
1021 lsr x3, x3, #32
1022 mov v25.s[1], w3
1023 umull x3, w12, w23
1024 ldr x15, [pointx+24]
1025 mov v17.s[0], w15
1026 lsr x15, x15, #32
1027 mov v18.s[0], w15
1028 add x29, x19, x2, lsr #25
1029 umull v26.2d, v0.2s, v23.2s
1030 and x21, x28, #0x1ffffff // ubignum_of_xreglist 3 // INTERMEDIATE bce
1031 ldr x0, [tmpa+8]
1032 mov v2.s[1], w0
1033 lsr x0, x0, #32
1034 mov v3.s[1], w0
1035 umaddl x27, w21, w5, x3
1036 ldr x15, [pointx+32]
1037 mov v24.s[0], w15
1038 lsr x15, x15, #32
1039 mov v25.s[0], w15
1040 add x17, x24, x29, lsr #26
1041 umull v29.2d, v1.2s, v18.2s
1042 and x15, x8, #0x3ffffff // ubignum_of_xreglist 2 // INTERMEDIATE bce
1043 umull v20.2d, v0.2s, v15.2s
1044 add x19, x30, x17, lsr #25
1045 and x3, x17, #0x1ffffff // ubignum_of_xreglist 7 // INTERMEDIATE bce
1046 mul v12.2s, v25.2s, v31.2s
1047 ldr x0, [tmpa+16]
1048 mov v4.s[1], w0
1049 lsr x0, x0, #32
1050 mov v5.s[1], w0
1051 add x4, x20, x19, lsr #26 // ubignum_of_xreglist 9 // INTERMEDIATE bce
1052 umlal v26.2d, v2.2s, v11.2s
1053 add w28, w3, w3, lsl #1;
1054 umlal v20.2d, v2.2s, v23.2s
1055 add w28, w28, w3, lsl #4
1056 umull x8, w12, w5
1057 ldr x0, [tmpa+24]
1058 mov v6.s[1], w0
1059 lsr x0, x0, #32
1060 mov v7.s[1], w0
1061 and x30, x25, #0x3ffffff // ubignum_of_xreglist 4 // INTERMEDIATE bce
1062 mul v16.2s, v18.2s, v31.2s
1063 add w17, w4, w4, lsl #1;
1064 umull v21.2d, v1.2s, v15.2s
1065 add w17, w17, w4, lsl #4
1066 umaddl x25, w21, w7, x8
1067 umlal v20.2d, v4.2s, v11.2s
1068 add w8, w21, w21, lsl #1;
1069 ldr x0, [tmpa+32]
1070 add w8, w8, w21, lsl #4
1071 mov v8.s[1], w0
1072 lsr x0, x0, #32
1073 mov v9.s[1], w0
1074 and x2, x2, #0x1ffffff // ubignum_of_xreglist 5 // INTERMEDIATE bce
1075 umlal v29.2d, v3.2s, v15.2s
1076 umaddl x24, w2, w6, x25
1077 umull v13.2d, v0.2s, v25.2s
1078 umaddl x25, w2, w7, x27
1079 umaddl x0, w3, w6, x25
1080 mul v19.2s, v15.2s, v31.2s
1081 umull v27.2d, v0.2s, v18.2s
1082 umaddl x20, w3, w13, x24
1083 umlal v20.2d, v6.2s, v12.2s
1084 umaddl x24, w21, w14, x1
1085 umlal v13.2d, v2.2s, v18.2s
1086 umaddl x9, w4, w13, x0
1087 umull v25.2d, v0.2s, v11.2s
1088 umaddl x20, w17, w23, x20
1089 umlal v27.2d, v2.2s, v15.2s
1090 umaddl x0, w2, w26, x24
1091 umull v28.2d, v1.2s, v11.2s
1092 umull x24, w17, w5
1093 umlal v29.2d, v5.2s, v23.2s
1094 umaddl x9, w11, w22, x9
1095 umlal v13.2d, v4.2s, v15.2s
1096 umaddl x27, w3, w16, x0
1097 umlal v27.2d, v4.2s, v23.2s
1098 umull x0, w17, w14
1099 umlal v27.2d, v6.2s, v11.2s
1100 umull x4, w12, w14
1101 umlal v27.2d, v8.2s, v12.2s
1102 umaddl x25, w11, w10, x20
1103 umlal v27.2d, v1.2s, v17.2s
1104 umaddl x0, w28, w10, x0
1105 umlal v13.2d, v6.2s, v23.2s
1106 umull x3, w17, w6
1107 umlal v13.2d, v8.2s, v11.2s
1108 umaddl x1, w21, w26, x4
1109 umlal v20.2d, v8.2s, v16.2s
1110 umaddl x4, w2, w13, x24
1111 umlal v28.2d, v3.2s, v12.2s
1112 umaddl x20, w28, w7, x3
1113 umlal v29.2d, v7.2s, v11.2s
1114 and x3, x19, #0x3ffffff // ubignum_of_xreglist 9 // INTERMEDIATE bce
1115 umlal v29.2d, v9.2s, v12.2s
1116 umaddl x19, w17, w22, x27
1117 add w27, w2, w2, lsl #1;
1118 mul v18.2s, v24.2s, v31.2s
1119 add w27, w27, w2, lsl #4
1120 umlal v21.2d, v3.2s, v23.2s
1121 umull x24, w17, w7
1122 umlal v13.2d, v1.2s, v24.2s
1123 add x19, x19, x19
1124 shl v29.2d, v29.2d, #1
1125 umaddl x1, w2, w16, x1
1126 umull v15.2d, v1.2s, v23.2s
1127 umaddl x0, w27, w22, x0
1128 umlal v29.2d, v0.2s, v24.2s
1129 umaddl x2, w28, w5, x24
1130 mul v24.2s, v23.2s, v31.2s
1131 umaddl x4, w28, w23, x4
1132 umlal v21.2d, v5.2s, v11.2s
1133 umaddl x24, w27, w5, x20
1134 umlal v20.2d, v1.2s, v14.2s
1135 umaddl x20, w11, w23, x19
1136 umlal v26.2d, v4.2s, v12.2s
1137 umaddl x19, w27, w23, x2
1138 umlal v26.2d, v6.2s, v16.2s
1139 umaddl x2, w21, w6, x4
1140 umlal v29.2d, v2.2s, v17.2s
1141 umaddl x24, w8, w23, x24
1142 umlal v15.2d, v3.2s, v11.2s
1143 umaddl x0, w21, w16, x0
1144 umaddl x4, w21, w13, x19
1145 mul v23.2s, v11.2s, v31.2s
1146 umlal v20.2d, v3.2s, v22.2s
1147 umaddl x2, w12, w7, x2
1148 umlal v20.2d, v5.2s, v10.2s
1149 umaddl x19, w12, w26, x0
1150 umlal v29.2d, v4.2s, v14.2s
1151 umaddl x0, w12, w13, x24
1152 umlal v26.2d, v8.2s, v19.2s
1153 umaddl x20, w15, w5, x20
1154 umlal v26.2d, v1.2s, v22.2s
1155 umaddl x21, w15, w10, x9
1156 umlal v26.2d, v3.2s, v10.2s
1157 and x9, x29, #0x3ffffff // ubignum_of_xreglist 6 // INTERMEDIATE bce
1158 umlal v29.2d, v6.2s, v22.2s
1159 umaddl x20, w30, w7, x20
1160 umaddl x1, w28, w22, x1
1161 add x24, x19, x19
1162 umull v11.2d, v1.2s, v12.2s
1163 add w19, w3, w3, lsl #1;
1164 umlal v26.2d, v5.2s, v18.2s
1165 add w19, w19, w3, lsl #4
1166 umaddl x20, w9, w6, x20
1167 umlal v29.2d, v8.2s, v10.2s
1168 add w29, w9, w9, lsl #1;
1169 umlal v13.2d, v3.2s, v17.2s
1170 add w29, w29, w9, lsl #4
1171 umaddl x2, w19, w10, x2
1172 umlal v11.2d, v3.2s, v16.2s
1173 umaddl x21, w30, w14, x21
1174 umlal v11.2d, v5.2s, v19.2s
1175 umaddl x20, w3, w13, x20
1176 umlal v11.2d, v7.2s, v24.2s
1177 umaddl x2, w29, w22, x2
1178 umlal v11.2d, v9.2s, v23.2s
1179 umaddl x21, w9, w26, x21
1180 ushr v23.2d, v30.2d, #1
1181 umaddl x1, w17, w10, x1
1182 umlal v13.2d, v5.2s, v14.2s
1183 umaddl x24, w19, w5, x24
1184 umlal v27.2d, v3.2s, v14.2s
1185 umaddl x21, w3, w16, x21
1186 shl v11.2d, v11.2d, #1
1187 add w3, w30, w30, lsl #1;
1188 umlal v28.2d, v5.2s, v16.2s
1189 add w3, w3, w30, lsl #4
1190 umaddl x24, w29, w23, x24
1191 umlal v28.2d, v7.2s, v19.2s
1192 add x1, x1, x1
1193 umlal v28.2d, v9.2s, v24.2s
1194 umaddl x1, w11, w5, x1
1195 umlal v15.2d, v5.2s, v12.2s
1196 umaddl x24, w30, w13, x24
1197 umlal v15.2d, v7.2s, v16.2s
1198 umaddl x25, w15, w14, x25
1199 umlal v15.2d, v9.2s, v19.2s
1200 umaddl x1, w15, w7, x1
1201 shl v28.2d, v28.2d, #1
1202 umaddl x24, w15, w6, x24
1203 umlal v21.2d, v7.2s, v12.2s
1204 umaddl x2, w30, w16, x2
1205 umlal v21.2d, v9.2s, v16.2s
1206 umaddl x25, w30, w26, x25
1207 shl v15.2d, v15.2d, #1
1208 umaddl x30, w30, w6, x1
1209 umlal v28.2d, v0.2s, v22.2s
1210 umaddl x1, w15, w26, x2
1211 umlal v28.2d, v2.2s, v10.2s
1212 umaddl x2, w9, w16, x25
1213 shl v21.2d, v21.2d, #1
1214 umaddl x24, w11, w7, x24
1215 umlal v15.2d, v0.2s, v14.2s
1216 umaddl x1, w11, w14, x1
1217 umlal v21.2d, v0.2s, v17.2s
1218 umaddl x25, w9, w13, x30
1219 umlal v28.2d, v4.2s, v18.2s
1220 umaddl x0, w19, w26, x0
1221 umlal v25.2d, v2.2s, v12.2s
1222 add x1, x1, x24, lsr #26
1223 umlal v25.2d, v4.2s, v16.2s
1224 umaddl x30, w19, w22, x2
1225 umlal v21.2d, v2.2s, v14.2s
1226 umaddl x4, w12, w6, x4
1227 mul v14.2s, v14.2s, v31.2s
1228 umaddl x25, w19, w23, x25
1229 and x2, x1, #0x1ffffff
1230 mul v16.2s, v17.2s, v31.2s
1231 umlal v25.2d, v6.2s, v19.2s
1232 umaddl x9, w19, w14, x4
1233 umlal v13.2d, v7.2s, v22.2s
1234 add x25, x25, x1, lsr #25
1235 umlal v21.2d, v4.2s, v22.2s
1236 umaddl x0, w29, w14, x0
1237 umlal v26.2d, v7.2s, v16.2s
1238 add x30, x30, x25, lsr #26
1239 umlal v26.2d, v9.2s, v14.2s
1240 add w1, w15, w15, lsl #1;
1241 umlal v28.2d, v6.2s, v16.2s
1242 add w1, w1, w15, lsl #4
1243 add x4, x20, x30, lsr #25
1244 umlal v28.2d, v8.2s, v14.2s
1245 and x25, x25, #0x3ffffff
1246 umlal v15.2d, v2.2s, v22.2s
1247 add x21, x21, x4, lsr #26
1248 umlal v11.2d, v0.2s, v10.2s
1249 bfi x25, x30, #32, #25 // ubignum_of_preglist 3 // INTERMEDIATE z4
1250 umlal v11.2d, v2.2s, v18.2s
1251 bic x30, x21, #0x3ffffff
1252 usra v26.2d, v28.2d, #26
1253 lsr x20, x30, #26
1254 umlal v15.2d, v4.2s, v10.2s
1255 add x20, x20, x30, lsr #25
1256 umlal v15.2d, v6.2s, v18.2s
1257 umaddl x9, w29, w10, x9
1258 umlal v15.2d, v8.2s, v16.2s
1259 add x30, x20, x30, lsr #22
1260 umlal v27.2d, v5.2s, v22.2s
1261 umull x20, w17, w26
1262 umlal v20.2d, v7.2s, v18.2s
1263 umaddl x30, w17, w16, x30
1264 umlal v20.2d, v9.2s, v16.2s
1265 umaddl x17, w3, w10, x0
1266 usra v15.2d, v26.2d, #25
1267 umaddl x0, w28, w14, x20
1268 umlal v27.2d, v7.2s, v10.2s
1269 umaddl x20, w28, w26, x30
1270 umlal v27.2d, v9.2s, v18.2s
1271 add w28, w12, w12, lsl #1;
1272 usra v20.2d, v15.2d, #26
1273 add w28, w28, w12, lsl #4
1274 umaddl x30, w27, w10, x0
1275 and v17.16b, v15.16b, v30.16b // ubignum_of_hreglist 4 + ubignum_of_lreglist 4 // INTERMEDIATE H|L = x4|z5
1276 umaddl x27, w27, w14, x20
1277 umaddl x0, w8, w10, x27
1278 mul v12.2s, v22.2s, v31.2s
1279 and v15.16b, v20.16b, v23.16b // ubignum_of_hreglist 5 + ubignum_of_lreglist 5 // INTERMEDIATE H|L = x4|z5
1280 umaddl x14, w3, w22, x9
1281 umlal v21.2d, v6.2s, v10.2s
1282 umaddl x27, w8, w22, x30
1283 trn1 v15.4s, v17.4s, v15.4s // FINAL z3
1284 umaddl x10, w28, w22, x0
1285 umlal v11.2d, v4.2s, v16.2s
1286 umaddl x30, w15, w16, x14
1287 and v26.16b, v26.16b, v23.16b
1288 umaddl x28, w12, w16, x27
1289 umlal v21.2d, v8.2s, v18.2s
1290 add x10, x10, x10
1291 umlal v25.2d, v8.2s, v24.2s
1292 umaddl x20, w19, w6, x10
1293 umlal v25.2d, v1.2s, v10.2s
1294 add x28, x28, x28
1295 umlal v25.2d, v3.2s, v18.2s
1296 umaddl x28, w19, w7, x28
1297 usra v21.2d, v20.2d, #25
1298 umaddl x0, w29, w7, x20
1299 umlal v11.2d, v6.2s, v14.2s
1300 umaddl x10, w11, w26, x30
1301 umlal v13.2d, v9.2s, v10.2s
1302 umaddl x19, w29, w5, x28
1303 usra v27.2d, v21.2d, #26
1304 umaddl x0, w3, w5, x0
1305 umlal v25.2d, v5.2s, v16.2s
1306 umaddl x20, w1, w22, x17
1307 and v20.16b, v28.16b, v30.16b
1308 umaddl x29, w3, w23, x19
1309 usra v29.2d, v27.2d, #25
1310 umaddl x3, w1, w23, x0
1311 and v27.16b, v27.16b, v23.16b // ubignum_of_hreglist 7 + ubignum_of_lreglist 7 // INTERMEDIATE H|L = x4|z5
1312 umlal v11.2d, v8.2s, v12.2s
1313 umaddl x12, w15, w13, x29
1314 usra v13.2d, v29.2d, #26
1315 umaddl x7, w11, w13, x3
1316 trn1 v6.4s, v6.4s, v7.4s
1317 umaddl x17, w11, w16, x20
1318 umlal v25.2d, v7.2s, v14.2s
1319 and x23, x4, #0x3ffffff
1320 bic v19.16b, v13.16b, v23.16b
1321 umaddl x19, w11, w6, x12
1322 and v28.16b, v13.16b, v23.16b // ubignum_of_hreglist 9 + ubignum_of_lreglist 9 // INTERMEDIATE H|L = x4|z5
1323 add x3, x17, x7, lsr #26
1324 usra v11.2d, v19.2d, #25
1325 trn1 v2.4s, v2.4s, v3.4s
1326 add x17, x19, x3, lsr #25
1327 and v13.16b, v21.16b, v30.16b // ubignum_of_hreglist 6 + ubignum_of_lreglist 6 // INTERMEDIATE H|L = x4|z5
1328 and x5, x7, #0x3ffffff
1329 usra v11.2d, v19.2d, #24
1330 add x7, x10, x17, lsr #26
1331 trn1 v0.4s, v0.4s, v1.4s
1332 and x19, x24, #0x3ffffff
1333 and v21.16b, v29.16b, v30.16b // ubignum_of_hreglist 8 + ubignum_of_lreglist 8 // INTERMEDIATE H|L = x4|z5
1334 add x29, x19, x7, lsr #25
1335 usra v11.2d, v19.2d, #21
1336 bfi x5, x3, #32, #25 // ubignum_of_preglist 0 // INTERMEDIATE z4
1337 trn1 v17.4s, v13.4s, v27.4s // FINAL z3
1338 add x19, x2, x29, lsr #26
1339 trn1 v19.4s, v21.4s, v28.4s // FINAL z3
1340 and x3, x29, #0x3ffffff
1341 mov v16.d[0], v6.d[1] // FINAL x3
1342 mov v6.d[0], v17.d[1] // FINAL x2
1343 trn1 v8.4s, v8.4s, v9.4s
1344 bfi x3, x19, #32, #26 // ubignum_of_preglist 2 // INTERMEDIATE z4
1345 and v21.16b, v11.16b, v30.16b // ubignum_of_hreglist 0 + ubignum_of_lreglist 0 // INTERMEDIATE H|L = x4|z5
1346 bfi x23, x21, #32, #26 // ubignum_of_preglist 4 // INTERMEDIATE z4
1347 mov v18.d[0], v8.d[1] // FINAL x3
1348 mov v8.d[0], v19.d[1] // FINAL x2
1349 umlal v25.2d, v9.2s, v12.2s
1350 mov v9.d[0], x23 // FINAL z2
1351 mov v7.d[0], x25 // FINAL z2
1352 ldr d29, [mask1]
1353 mov v12.d[0], v2.d[1] // FINAL x3
1354 trn1 v4.4s, v4.4s, v5.4s
1355 and x17, x17, #0x3ffffff
1356 usra v25.2d, v11.2d, #26
1357 mov v10.d[0], v0.d[1] // FINAL x3
1358 mov v14.d[0], v4.d[1] // FINAL x3
1359 mov v4.d[0], v15.d[1] // FINAL x2
1360 usra v20.2d, v25.2d, #25
1361 and v27.16b, v25.16b, v23.16b // ubignum_of_hreglist 1 + ubignum_of_lreglist 1 // INTERMEDIATE H|L = x4|z5
1362 bfi x17, x7, #32, #25 // ubignum_of_preglist 1 // INTERMEDIATE z4
1363 mov v5.d[0], x3 // depth 86
1364 mov v1.d[0], x5 // FINAL z2
1365 usra v26.2d, v20.2d, #26 // ubignum_of_hreglist 3 + ubignum_of_lreglist 3 // INTERMEDIATE H|L = x4|z5
1366 and v28.16b, v20.16b, v30.16b // ubignum_of_hreglist 2 + ubignum_of_lreglist 2 // INTERMEDIATE H|L = x4|z5
1367 trn1 v11.4s, v21.4s, v27.4s // FINAL z3
1368 trn1 v13.4s, v28.4s, v26.4s // FINAL z3
1369 mov v0.d[0], v11.d[1] // FINAL x2
1370 mov v3.d[0], x17 // FINAL z2
1371 mov v2.d[0], v13.d[1] // FINAL x2
1372 ldr d28, [mask2]
1373
1374 ldr x0, [i]
1375 subs x0, x0, #1
1376 str x0, [i]
1377 bcs curve25519_x25519_byte_scalarloop
1378
1379 // Repack X2 into the saturated representation as 256-bit value xn.
1380 // This does not fully normalize mod 2^255-19 but stays within 256 bits.
1381
1382 mov w0, v0.s[0]
1383 mov w1, v0.s[1]
1384 mov w2, v2.s[0]
1385 mov w3, v2.s[1]
1386 mov w4, v4.s[0]
1387 mov w5, v4.s[1]
1388 mov w6, v6.s[0]
1389 mov w7, v6.s[1]
1390 mov w8, v8.s[0]
1391 mov w9, v8.s[1]
1392
1393 add x0, x0, x1, lsl #26
1394 add x1, x2, x3, lsl #26
1395 add x2, x4, x5, lsl #26
1396 add x3, x6, x7, lsl #26
1397 add x4, x8, x9, lsl #26
1398
1399 adds x0, x0, x1, lsl #51
1400 lsr x6, x1, #13
1401 lsl x7, x2, #38
1402 adcs x1, x6, x7
1403 lsr x8, x2, #26
1404 lsl x9, x3, #25
1405 adcs x2, x8, x9
1406 lsr x10, x3, #39
1407 lsl x11, x4, #12
1408 adc x3, x10, x11
1409 stp x0, x1, [xn]
1410 stp x2, x3, [xn+16]
1411
1412 // Repack Z2 into the saturated representation as 256-bit value zn.
1413 // This does not fully normalize mod 2^255-19. However since Z2,
1414 // unlike X2, was not repacked (within the last multiplication) in
1415 // right-to-left order, its top digit can be any 26-bit value, on
1416 // the face of it. To make sure we don't overflow 256 bits here
1417 // we remove b = 25th bit of the 9th digit (now scaled by 2^230
1418 // giving bit 25 a final weighting of 2^255) and add 19 * b to
1419 // to the bottom of the sum here to compensate mod 2^255-19.
1420
1421 mov w0, v1.s[0]
1422 mov w1, v1.s[1]
1423 mov w2, v3.s[0]
1424 mov w3, v3.s[1]
1425 mov w4, v5.s[0]
1426 mov w5, v5.s[1]
1427 mov w6, v7.s[0]
1428 mov w7, v7.s[1]
1429 mov w8, v9.s[0]
1430 mov w9, v9.s[1]
1431
1432 mov w10, #19
1433 add x0, x0, x1, lsl #26
1434 tst x9, #0x2000000
1435 add x1, x2, x3, lsl #26
1436 csel x10, x10, xzr, ne
1437 add x2, x4, x5, lsl #26
1438 and x9, x9, #0x1FFFFFF
1439 add x3, x6, x7, lsl #26
1440 add x0, x0, x10
1441 add x4, x8, x9, lsl #26
1442
1443 adds x0, x0, x1, lsl #51
1444 lsr x6, x1, #13
1445 lsl x7, x2, #38
1446 adcs x1, x6, x7
1447 lsr x8, x2, #26
1448 lsl x9, x3, #25
1449 adcs x2, x8, x9
1450 lsr x10, x3, #39
1451 lsl x11, x4, #12
1452 adc x3, x10, x11
1453 stp x0, x1, [zn]
1454 stp x2, x3, [zn+16]
1455
1456 // Because the lowest bit (indeed, the three lowest bits) of the scalar
1457 // were forced to zero, we know that the projective result of the scalar
1458 // multiplication was in (X2,Z2) and is now (xn,zn) in saturated form.
1459 // Prepare to call the modular inverse function to get zn' = 1/zn.
1460
1461 add x0, zn
1462 add x1, zn
1463
1464 // Inline copy of bignum_inv_p25519, identical except for stripping out
1465 // the prologue and epilogue saving and restoring registers and making
1466 // and reclaiming room on the stack. For more details and explanations see
1467 // "arm/curve25519/bignum_inv_p25519.S". Note that the stack it uses for
1468 // its own temporaries is 128 bytes, so it has no effect on variables
1469 // that are needed in the rest of our computation here: res, xn, and zn.
1470
1471 mov x20, x0
1472 mov x10, #0xffffffffffffffed
1473 mov x11, #0xffffffffffffffff
1474 stp x10, x11, [sp]
1475 mov x12, #0x7fffffffffffffff
1476 stp x11, x12, [sp, #16]
1477 ldp x2, x3, [x1]
1478 ldp x4, x5, [x1, #16]
1479 mov x7, #0x13
1480 lsr x6, x5, #63
1481 madd x6, x7, x6, x7
1482 adds x2, x2, x6
1483 adcs x3, x3, xzr
1484 adcs x4, x4, xzr
1485 orr x5, x5, #0x8000000000000000
1486 adcs x5, x5, xzr
1487 csel x6, x7, xzr, cc
1488 subs x2, x2, x6
1489 sbcs x3, x3, xzr
1490 sbcs x4, x4, xzr
1491 sbc x5, x5, xzr
1492 and x5, x5, #0x7fffffffffffffff
1493 stp x2, x3, [sp, #32]
1494 stp x4, x5, [sp, #48]
1495 stp xzr, xzr, [sp, #64]
1496 stp xzr, xzr, [sp, #80]
1497 mov x10, #0x2099
1498 movk x10, #0x7502, lsl #16
1499 movk x10, #0x9e23, lsl #32
1500 movk x10, #0xa0f9, lsl #48
1501 mov x11, #0x2595
1502 movk x11, #0x1d13, lsl #16
1503 movk x11, #0x8f3f, lsl #32
1504 movk x11, #0xa8c6, lsl #48
1505 mov x12, #0x5242
1506 movk x12, #0x5ac, lsl #16
1507 movk x12, #0x8938, lsl #32
1508 movk x12, #0x6c6c, lsl #48
1509 mov x13, #0x615
1510 movk x13, #0x4177, lsl #16
1511 movk x13, #0x8b2, lsl #32
1512 movk x13, #0x2765, lsl #48
1513 stp x10, x11, [sp, #96]
1514 stp x12, x13, [sp, #112]
1515 mov x21, #0xa
1516 mov x22, #0x1
1517 b curve25519_x25519_byte_invmidloop
1518 curve25519_x25519_byte_invloop:
1519 cmp x10, xzr
1520 csetm x14, mi
1521 cneg x10, x10, mi
1522 cmp x11, xzr
1523 csetm x15, mi
1524 cneg x11, x11, mi
1525 cmp x12, xzr
1526 csetm x16, mi
1527 cneg x12, x12, mi
1528 cmp x13, xzr
1529 csetm x17, mi
1530 cneg x13, x13, mi
1531 and x0, x10, x14
1532 and x1, x11, x15
1533 add x9, x0, x1
1534 and x0, x12, x16
1535 and x1, x13, x17
1536 add x19, x0, x1
1537 ldr x7, [sp]
1538 eor x1, x7, x14
1539 mul x0, x1, x10
1540 umulh x1, x1, x10
1541 adds x4, x9, x0
1542 adc x2, xzr, x1
1543 ldr x8, [sp, #32]
1544 eor x1, x8, x15
1545 mul x0, x1, x11
1546 umulh x1, x1, x11
1547 adds x4, x4, x0
1548 adc x2, x2, x1
1549 eor x1, x7, x16
1550 mul x0, x1, x12
1551 umulh x1, x1, x12
1552 adds x5, x19, x0
1553 adc x3, xzr, x1
1554 eor x1, x8, x17
1555 mul x0, x1, x13
1556 umulh x1, x1, x13
1557 adds x5, x5, x0
1558 adc x3, x3, x1
1559 ldr x7, [sp, #8]
1560 eor x1, x7, x14
1561 mul x0, x1, x10
1562 umulh x1, x1, x10
1563 adds x2, x2, x0
1564 adc x6, xzr, x1
1565 ldr x8, [sp, #40]
1566 eor x1, x8, x15
1567 mul x0, x1, x11
1568 umulh x1, x1, x11
1569 adds x2, x2, x0
1570 adc x6, x6, x1
1571 extr x4, x2, x4, #59
1572 str x4, [sp]
1573 eor x1, x7, x16
1574 mul x0, x1, x12
1575 umulh x1, x1, x12
1576 adds x3, x3, x0
1577 adc x4, xzr, x1
1578 eor x1, x8, x17
1579 mul x0, x1, x13
1580 umulh x1, x1, x13
1581 adds x3, x3, x0
1582 adc x4, x4, x1
1583 extr x5, x3, x5, #59
1584 str x5, [sp, #32]
1585 ldr x7, [sp, #16]
1586 eor x1, x7, x14
1587 mul x0, x1, x10
1588 umulh x1, x1, x10
1589 adds x6, x6, x0
1590 adc x5, xzr, x1
1591 ldr x8, [sp, #48]
1592 eor x1, x8, x15
1593 mul x0, x1, x11
1594 umulh x1, x1, x11
1595 adds x6, x6, x0
1596 adc x5, x5, x1
1597 extr x2, x6, x2, #59
1598 str x2, [sp, #8]
1599 eor x1, x7, x16
1600 mul x0, x1, x12
1601 umulh x1, x1, x12
1602 adds x4, x4, x0
1603 adc x2, xzr, x1
1604 eor x1, x8, x17
1605 mul x0, x1, x13
1606 umulh x1, x1, x13
1607 adds x4, x4, x0
1608 adc x2, x2, x1
1609 extr x3, x4, x3, #59
1610 str x3, [sp, #40]
1611 ldr x7, [sp, #24]
1612 eor x1, x7, x14
1613 asr x3, x1, #63
1614 and x3, x3, x10
1615 neg x3, x3
1616 mul x0, x1, x10
1617 umulh x1, x1, x10
1618 adds x5, x5, x0
1619 adc x3, x3, x1
1620 ldr x8, [sp, #56]
1621 eor x1, x8, x15
1622 asr x0, x1, #63
1623 and x0, x0, x11
1624 sub x3, x3, x0
1625 mul x0, x1, x11
1626 umulh x1, x1, x11
1627 adds x5, x5, x0
1628 adc x3, x3, x1
1629 extr x6, x5, x6, #59
1630 str x6, [sp, #16]
1631 extr x5, x3, x5, #59
1632 str x5, [sp, #24]
1633 eor x1, x7, x16
1634 asr x5, x1, #63
1635 and x5, x5, x12
1636 neg x5, x5
1637 mul x0, x1, x12
1638 umulh x1, x1, x12
1639 adds x2, x2, x0
1640 adc x5, x5, x1
1641 eor x1, x8, x17
1642 asr x0, x1, #63
1643 and x0, x0, x13
1644 sub x5, x5, x0
1645 mul x0, x1, x13
1646 umulh x1, x1, x13
1647 adds x2, x2, x0
1648 adc x5, x5, x1
1649 extr x4, x2, x4, #59
1650 str x4, [sp, #48]
1651 extr x2, x5, x2, #59
1652 str x2, [sp, #56]
1653 ldr x7, [sp, #64]
1654 eor x1, x7, x14
1655 mul x0, x1, x10
1656 umulh x1, x1, x10
1657 adds x4, x9, x0
1658 adc x2, xzr, x1
1659 ldr x8, [sp, #96]
1660 eor x1, x8, x15
1661 mul x0, x1, x11
1662 umulh x1, x1, x11
1663 adds x4, x4, x0
1664 str x4, [sp, #64]
1665 adc x2, x2, x1
1666 eor x1, x7, x16
1667 mul x0, x1, x12
1668 umulh x1, x1, x12
1669 adds x5, x19, x0
1670 adc x3, xzr, x1
1671 eor x1, x8, x17
1672 mul x0, x1, x13
1673 umulh x1, x1, x13
1674 adds x5, x5, x0
1675 str x5, [sp, #96]
1676 adc x3, x3, x1
1677 ldr x7, [sp, #72]
1678 eor x1, x7, x14
1679 mul x0, x1, x10
1680 umulh x1, x1, x10
1681 adds x2, x2, x0
1682 adc x6, xzr, x1
1683 ldr x8, [sp, #104]
1684 eor x1, x8, x15
1685 mul x0, x1, x11
1686 umulh x1, x1, x11
1687 adds x2, x2, x0
1688 str x2, [sp, #72]
1689 adc x6, x6, x1
1690 eor x1, x7, x16
1691 mul x0, x1, x12
1692 umulh x1, x1, x12
1693 adds x3, x3, x0
1694 adc x4, xzr, x1
1695 eor x1, x8, x17
1696 mul x0, x1, x13
1697 umulh x1, x1, x13
1698 adds x3, x3, x0
1699 str x3, [sp, #104]
1700 adc x4, x4, x1
1701 ldr x7, [sp, #80]
1702 eor x1, x7, x14
1703 mul x0, x1, x10
1704 umulh x1, x1, x10
1705 adds x6, x6, x0
1706 adc x5, xzr, x1
1707 ldr x8, [sp, #112]
1708 eor x1, x8, x15
1709 mul x0, x1, x11
1710 umulh x1, x1, x11
1711 adds x6, x6, x0
1712 str x6, [sp, #80]
1713 adc x5, x5, x1
1714 eor x1, x7, x16
1715 mul x0, x1, x12
1716 umulh x1, x1, x12
1717 adds x4, x4, x0
1718 adc x2, xzr, x1
1719 eor x1, x8, x17
1720 mul x0, x1, x13
1721 umulh x1, x1, x13
1722 adds x4, x4, x0
1723 str x4, [sp, #112]
1724 adc x2, x2, x1
1725 ldr x7, [sp, #88]
1726 eor x1, x7, x14
1727 and x3, x14, x10
1728 neg x3, x3
1729 mul x0, x1, x10
1730 umulh x1, x1, x10
1731 adds x5, x5, x0
1732 adc x3, x3, x1
1733 ldr x8, [sp, #120]
1734 eor x1, x8, x15
1735 and x0, x15, x11
1736 sub x3, x3, x0
1737 mul x0, x1, x11
1738 umulh x1, x1, x11
1739 adds x5, x5, x0
1740 adc x3, x3, x1
1741 extr x6, x3, x5, #63
1742 ldp x0, x1, [sp, #64]
1743 add x6, x6, x3, asr #63
1744 mov x3, #0x13
1745 mul x4, x6, x3
1746 add x5, x5, x6, lsl #63
1747 smulh x3, x6, x3
1748 ldr x6, [sp, #80]
1749 adds x0, x0, x4
1750 adcs x1, x1, x3
1751 asr x3, x3, #63
1752 adcs x6, x6, x3
1753 adc x5, x5, x3
1754 stp x0, x1, [sp, #64]
1755 stp x6, x5, [sp, #80]
1756 eor x1, x7, x16
1757 and x5, x16, x12
1758 neg x5, x5
1759 mul x0, x1, x12
1760 umulh x1, x1, x12
1761 adds x2, x2, x0
1762 adc x5, x5, x1
1763 eor x1, x8, x17
1764 and x0, x17, x13
1765 sub x5, x5, x0
1766 mul x0, x1, x13
1767 umulh x1, x1, x13
1768 adds x2, x2, x0
1769 adc x5, x5, x1
1770 extr x6, x5, x2, #63
1771 ldp x0, x1, [sp, #96]
1772 add x6, x6, x5, asr #63
1773 mov x5, #0x13
1774 mul x4, x6, x5
1775 add x2, x2, x6, lsl #63
1776 smulh x5, x6, x5
1777 ldr x3, [sp, #112]
1778 adds x0, x0, x4
1779 adcs x1, x1, x5
1780 asr x5, x5, #63
1781 adcs x3, x3, x5
1782 adc x2, x2, x5
1783 stp x0, x1, [sp, #96]
1784 stp x3, x2, [sp, #112]
1785 curve25519_x25519_byte_invmidloop:
1786 mov x1, x22
1787 ldr x2, [sp]
1788 ldr x3, [sp, #32]
1789 and x4, x2, #0xfffff
1790 orr x4, x4, #0xfffffe0000000000
1791 and x5, x3, #0xfffff
1792 orr x5, x5, #0xc000000000000000
1793 tst x5, #0x1
1794 csel x6, x4, xzr, ne
1795 ccmp x1, xzr, #0x8, ne
1796 cneg x1, x1, ge
1797 cneg x6, x6, ge
1798 csel x4, x5, x4, ge
1799 add x5, x5, x6
1800 add x1, x1, #0x2
1801 tst x5, #0x2
1802 asr x5, x5, #1
1803 csel x6, x4, xzr, ne
1804 ccmp x1, xzr, #0x8, ne
1805 cneg x1, x1, ge
1806 cneg x6, x6, ge
1807 csel x4, x5, x4, ge
1808 add x5, x5, x6
1809 add x1, x1, #0x2
1810 tst x5, #0x2
1811 asr x5, x5, #1
1812 csel x6, x4, xzr, ne
1813 ccmp x1, xzr, #0x8, ne
1814 cneg x1, x1, ge
1815 cneg x6, x6, ge
1816 csel x4, x5, x4, ge
1817 add x5, x5, x6
1818 add x1, x1, #0x2
1819 tst x5, #0x2
1820 asr x5, x5, #1
1821 csel x6, x4, xzr, ne
1822 ccmp x1, xzr, #0x8, ne
1823 cneg x1, x1, ge
1824 cneg x6, x6, ge
1825 csel x4, x5, x4, ge
1826 add x5, x5, x6
1827 add x1, x1, #0x2
1828 tst x5, #0x2
1829 asr x5, x5, #1
1830 csel x6, x4, xzr, ne
1831 ccmp x1, xzr, #0x8, ne
1832 cneg x1, x1, ge
1833 cneg x6, x6, ge
1834 csel x4, x5, x4, ge
1835 add x5, x5, x6
1836 add x1, x1, #0x2
1837 tst x5, #0x2
1838 asr x5, x5, #1
1839 csel x6, x4, xzr, ne
1840 ccmp x1, xzr, #0x8, ne
1841 cneg x1, x1, ge
1842 cneg x6, x6, ge
1843 csel x4, x5, x4, ge
1844 add x5, x5, x6
1845 add x1, x1, #0x2
1846 tst x5, #0x2
1847 asr x5, x5, #1
1848 csel x6, x4, xzr, ne
1849 ccmp x1, xzr, #0x8, ne
1850 cneg x1, x1, ge
1851 cneg x6, x6, ge
1852 csel x4, x5, x4, ge
1853 add x5, x5, x6
1854 add x1, x1, #0x2
1855 tst x5, #0x2
1856 asr x5, x5, #1
1857 csel x6, x4, xzr, ne
1858 ccmp x1, xzr, #0x8, ne
1859 cneg x1, x1, ge
1860 cneg x6, x6, ge
1861 csel x4, x5, x4, ge
1862 add x5, x5, x6
1863 add x1, x1, #0x2
1864 tst x5, #0x2
1865 asr x5, x5, #1
1866 csel x6, x4, xzr, ne
1867 ccmp x1, xzr, #0x8, ne
1868 cneg x1, x1, ge
1869 cneg x6, x6, ge
1870 csel x4, x5, x4, ge
1871 add x5, x5, x6
1872 add x1, x1, #0x2
1873 tst x5, #0x2
1874 asr x5, x5, #1
1875 csel x6, x4, xzr, ne
1876 ccmp x1, xzr, #0x8, ne
1877 cneg x1, x1, ge
1878 cneg x6, x6, ge
1879 csel x4, x5, x4, ge
1880 add x5, x5, x6
1881 add x1, x1, #0x2
1882 tst x5, #0x2
1883 asr x5, x5, #1
1884 csel x6, x4, xzr, ne
1885 ccmp x1, xzr, #0x8, ne
1886 cneg x1, x1, ge
1887 cneg x6, x6, ge
1888 csel x4, x5, x4, ge
1889 add x5, x5, x6
1890 add x1, x1, #0x2
1891 tst x5, #0x2
1892 asr x5, x5, #1
1893 csel x6, x4, xzr, ne
1894 ccmp x1, xzr, #0x8, ne
1895 cneg x1, x1, ge
1896 cneg x6, x6, ge
1897 csel x4, x5, x4, ge
1898 add x5, x5, x6
1899 add x1, x1, #0x2
1900 tst x5, #0x2
1901 asr x5, x5, #1
1902 csel x6, x4, xzr, ne
1903 ccmp x1, xzr, #0x8, ne
1904 cneg x1, x1, ge
1905 cneg x6, x6, ge
1906 csel x4, x5, x4, ge
1907 add x5, x5, x6
1908 add x1, x1, #0x2
1909 tst x5, #0x2
1910 asr x5, x5, #1
1911 csel x6, x4, xzr, ne
1912 ccmp x1, xzr, #0x8, ne
1913 cneg x1, x1, ge
1914 cneg x6, x6, ge
1915 csel x4, x5, x4, ge
1916 add x5, x5, x6
1917 add x1, x1, #0x2
1918 tst x5, #0x2
1919 asr x5, x5, #1
1920 csel x6, x4, xzr, ne
1921 ccmp x1, xzr, #0x8, ne
1922 cneg x1, x1, ge
1923 cneg x6, x6, ge
1924 csel x4, x5, x4, ge
1925 add x5, x5, x6
1926 add x1, x1, #0x2
1927 tst x5, #0x2
1928 asr x5, x5, #1
1929 csel x6, x4, xzr, ne
1930 ccmp x1, xzr, #0x8, ne
1931 cneg x1, x1, ge
1932 cneg x6, x6, ge
1933 csel x4, x5, x4, ge
1934 add x5, x5, x6
1935 add x1, x1, #0x2
1936 tst x5, #0x2
1937 asr x5, x5, #1
1938 csel x6, x4, xzr, ne
1939 ccmp x1, xzr, #0x8, ne
1940 cneg x1, x1, ge
1941 cneg x6, x6, ge
1942 csel x4, x5, x4, ge
1943 add x5, x5, x6
1944 add x1, x1, #0x2
1945 tst x5, #0x2
1946 asr x5, x5, #1
1947 csel x6, x4, xzr, ne
1948 ccmp x1, xzr, #0x8, ne
1949 cneg x1, x1, ge
1950 cneg x6, x6, ge
1951 csel x4, x5, x4, ge
1952 add x5, x5, x6
1953 add x1, x1, #0x2
1954 tst x5, #0x2
1955 asr x5, x5, #1
1956 csel x6, x4, xzr, ne
1957 ccmp x1, xzr, #0x8, ne
1958 cneg x1, x1, ge
1959 cneg x6, x6, ge
1960 csel x4, x5, x4, ge
1961 add x5, x5, x6
1962 add x1, x1, #0x2
1963 tst x5, #0x2
1964 asr x5, x5, #1
1965 csel x6, x4, xzr, ne
1966 ccmp x1, xzr, #0x8, ne
1967 cneg x1, x1, ge
1968 cneg x6, x6, ge
1969 csel x4, x5, x4, ge
1970 add x5, x5, x6
1971 add x1, x1, #0x2
1972 asr x5, x5, #1
1973 add x8, x4, #0x100, lsl #12
1974 sbfx x8, x8, #21, #21
1975 mov x11, #0x100000
1976 add x11, x11, x11, lsl #21
1977 add x9, x4, x11
1978 asr x9, x9, #42
1979 add x10, x5, #0x100, lsl #12
1980 sbfx x10, x10, #21, #21
1981 add x11, x5, x11
1982 asr x11, x11, #42
1983 mul x6, x8, x2
1984 mul x7, x9, x3
1985 mul x2, x10, x2
1986 mul x3, x11, x3
1987 add x4, x6, x7
1988 add x5, x2, x3
1989 asr x2, x4, #20
1990 asr x3, x5, #20
1991 and x4, x2, #0xfffff
1992 orr x4, x4, #0xfffffe0000000000
1993 and x5, x3, #0xfffff
1994 orr x5, x5, #0xc000000000000000
1995 tst x5, #0x1
1996 csel x6, x4, xzr, ne
1997 ccmp x1, xzr, #0x8, ne
1998 cneg x1, x1, ge
1999 cneg x6, x6, ge
2000 csel x4, x5, x4, ge
2001 add x5, x5, x6
2002 add x1, x1, #0x2
2003 tst x5, #0x2
2004 asr x5, x5, #1
2005 csel x6, x4, xzr, ne
2006 ccmp x1, xzr, #0x8, ne
2007 cneg x1, x1, ge
2008 cneg x6, x6, ge
2009 csel x4, x5, x4, ge
2010 add x5, x5, x6
2011 add x1, x1, #0x2
2012 tst x5, #0x2
2013 asr x5, x5, #1
2014 csel x6, x4, xzr, ne
2015 ccmp x1, xzr, #0x8, ne
2016 cneg x1, x1, ge
2017 cneg x6, x6, ge
2018 csel x4, x5, x4, ge
2019 add x5, x5, x6
2020 add x1, x1, #0x2
2021 tst x5, #0x2
2022 asr x5, x5, #1
2023 csel x6, x4, xzr, ne
2024 ccmp x1, xzr, #0x8, ne
2025 cneg x1, x1, ge
2026 cneg x6, x6, ge
2027 csel x4, x5, x4, ge
2028 add x5, x5, x6
2029 add x1, x1, #0x2
2030 tst x5, #0x2
2031 asr x5, x5, #1
2032 csel x6, x4, xzr, ne
2033 ccmp x1, xzr, #0x8, ne
2034 cneg x1, x1, ge
2035 cneg x6, x6, ge
2036 csel x4, x5, x4, ge
2037 add x5, x5, x6
2038 add x1, x1, #0x2
2039 tst x5, #0x2
2040 asr x5, x5, #1
2041 csel x6, x4, xzr, ne
2042 ccmp x1, xzr, #0x8, ne
2043 cneg x1, x1, ge
2044 cneg x6, x6, ge
2045 csel x4, x5, x4, ge
2046 add x5, x5, x6
2047 add x1, x1, #0x2
2048 tst x5, #0x2
2049 asr x5, x5, #1
2050 csel x6, x4, xzr, ne
2051 ccmp x1, xzr, #0x8, ne
2052 cneg x1, x1, ge
2053 cneg x6, x6, ge
2054 csel x4, x5, x4, ge
2055 add x5, x5, x6
2056 add x1, x1, #0x2
2057 tst x5, #0x2
2058 asr x5, x5, #1
2059 csel x6, x4, xzr, ne
2060 ccmp x1, xzr, #0x8, ne
2061 cneg x1, x1, ge
2062 cneg x6, x6, ge
2063 csel x4, x5, x4, ge
2064 add x5, x5, x6
2065 add x1, x1, #0x2
2066 tst x5, #0x2
2067 asr x5, x5, #1
2068 csel x6, x4, xzr, ne
2069 ccmp x1, xzr, #0x8, ne
2070 cneg x1, x1, ge
2071 cneg x6, x6, ge
2072 csel x4, x5, x4, ge
2073 add x5, x5, x6
2074 add x1, x1, #0x2
2075 tst x5, #0x2
2076 asr x5, x5, #1
2077 csel x6, x4, xzr, ne
2078 ccmp x1, xzr, #0x8, ne
2079 cneg x1, x1, ge
2080 cneg x6, x6, ge
2081 csel x4, x5, x4, ge
2082 add x5, x5, x6
2083 add x1, x1, #0x2
2084 tst x5, #0x2
2085 asr x5, x5, #1
2086 csel x6, x4, xzr, ne
2087 ccmp x1, xzr, #0x8, ne
2088 cneg x1, x1, ge
2089 cneg x6, x6, ge
2090 csel x4, x5, x4, ge
2091 add x5, x5, x6
2092 add x1, x1, #0x2
2093 tst x5, #0x2
2094 asr x5, x5, #1
2095 csel x6, x4, xzr, ne
2096 ccmp x1, xzr, #0x8, ne
2097 cneg x1, x1, ge
2098 cneg x6, x6, ge
2099 csel x4, x5, x4, ge
2100 add x5, x5, x6
2101 add x1, x1, #0x2
2102 tst x5, #0x2
2103 asr x5, x5, #1
2104 csel x6, x4, xzr, ne
2105 ccmp x1, xzr, #0x8, ne
2106 cneg x1, x1, ge
2107 cneg x6, x6, ge
2108 csel x4, x5, x4, ge
2109 add x5, x5, x6
2110 add x1, x1, #0x2
2111 tst x5, #0x2
2112 asr x5, x5, #1
2113 csel x6, x4, xzr, ne
2114 ccmp x1, xzr, #0x8, ne
2115 cneg x1, x1, ge
2116 cneg x6, x6, ge
2117 csel x4, x5, x4, ge
2118 add x5, x5, x6
2119 add x1, x1, #0x2
2120 tst x5, #0x2
2121 asr x5, x5, #1
2122 csel x6, x4, xzr, ne
2123 ccmp x1, xzr, #0x8, ne
2124 cneg x1, x1, ge
2125 cneg x6, x6, ge
2126 csel x4, x5, x4, ge
2127 add x5, x5, x6
2128 add x1, x1, #0x2
2129 tst x5, #0x2
2130 asr x5, x5, #1
2131 csel x6, x4, xzr, ne
2132 ccmp x1, xzr, #0x8, ne
2133 cneg x1, x1, ge
2134 cneg x6, x6, ge
2135 csel x4, x5, x4, ge
2136 add x5, x5, x6
2137 add x1, x1, #0x2
2138 tst x5, #0x2
2139 asr x5, x5, #1
2140 csel x6, x4, xzr, ne
2141 ccmp x1, xzr, #0x8, ne
2142 cneg x1, x1, ge
2143 cneg x6, x6, ge
2144 csel x4, x5, x4, ge
2145 add x5, x5, x6
2146 add x1, x1, #0x2
2147 tst x5, #0x2
2148 asr x5, x5, #1
2149 csel x6, x4, xzr, ne
2150 ccmp x1, xzr, #0x8, ne
2151 cneg x1, x1, ge
2152 cneg x6, x6, ge
2153 csel x4, x5, x4, ge
2154 add x5, x5, x6
2155 add x1, x1, #0x2
2156 tst x5, #0x2
2157 asr x5, x5, #1
2158 csel x6, x4, xzr, ne
2159 ccmp x1, xzr, #0x8, ne
2160 cneg x1, x1, ge
2161 cneg x6, x6, ge
2162 csel x4, x5, x4, ge
2163 add x5, x5, x6
2164 add x1, x1, #0x2
2165 tst x5, #0x2
2166 asr x5, x5, #1
2167 csel x6, x4, xzr, ne
2168 ccmp x1, xzr, #0x8, ne
2169 cneg x1, x1, ge
2170 cneg x6, x6, ge
2171 csel x4, x5, x4, ge
2172 add x5, x5, x6
2173 add x1, x1, #0x2
2174 asr x5, x5, #1
2175 add x12, x4, #0x100, lsl #12
2176 sbfx x12, x12, #21, #21
2177 mov x15, #0x100000
2178 add x15, x15, x15, lsl #21
2179 add x13, x4, x15
2180 asr x13, x13, #42
2181 add x14, x5, #0x100, lsl #12
2182 sbfx x14, x14, #21, #21
2183 add x15, x5, x15
2184 asr x15, x15, #42
2185 mul x6, x12, x2
2186 mul x7, x13, x3
2187 mul x2, x14, x2
2188 mul x3, x15, x3
2189 add x4, x6, x7
2190 add x5, x2, x3
2191 asr x2, x4, #20
2192 asr x3, x5, #20
2193 and x4, x2, #0xfffff
2194 orr x4, x4, #0xfffffe0000000000
2195 and x5, x3, #0xfffff
2196 orr x5, x5, #0xc000000000000000
2197 tst x5, #0x1
2198 csel x6, x4, xzr, ne
2199 ccmp x1, xzr, #0x8, ne
2200 cneg x1, x1, ge
2201 cneg x6, x6, ge
2202 csel x4, x5, x4, ge
2203 add x5, x5, x6
2204 add x1, x1, #0x2
2205 tst x5, #0x2
2206 asr x5, x5, #1
2207 csel x6, x4, xzr, ne
2208 ccmp x1, xzr, #0x8, ne
2209 cneg x1, x1, ge
2210 cneg x6, x6, ge
2211 csel x4, x5, x4, ge
2212 add x5, x5, x6
2213 add x1, x1, #0x2
2214 tst x5, #0x2
2215 asr x5, x5, #1
2216 csel x6, x4, xzr, ne
2217 ccmp x1, xzr, #0x8, ne
2218 cneg x1, x1, ge
2219 cneg x6, x6, ge
2220 csel x4, x5, x4, ge
2221 add x5, x5, x6
2222 add x1, x1, #0x2
2223 tst x5, #0x2
2224 asr x5, x5, #1
2225 csel x6, x4, xzr, ne
2226 ccmp x1, xzr, #0x8, ne
2227 cneg x1, x1, ge
2228 cneg x6, x6, ge
2229 csel x4, x5, x4, ge
2230 add x5, x5, x6
2231 add x1, x1, #0x2
2232 tst x5, #0x2
2233 asr x5, x5, #1
2234 csel x6, x4, xzr, ne
2235 ccmp x1, xzr, #0x8, ne
2236 cneg x1, x1, ge
2237 cneg x6, x6, ge
2238 csel x4, x5, x4, ge
2239 add x5, x5, x6
2240 add x1, x1, #0x2
2241 tst x5, #0x2
2242 asr x5, x5, #1
2243 csel x6, x4, xzr, ne
2244 ccmp x1, xzr, #0x8, ne
2245 cneg x1, x1, ge
2246 cneg x6, x6, ge
2247 csel x4, x5, x4, ge
2248 add x5, x5, x6
2249 add x1, x1, #0x2
2250 tst x5, #0x2
2251 asr x5, x5, #1
2252 csel x6, x4, xzr, ne
2253 ccmp x1, xzr, #0x8, ne
2254 cneg x1, x1, ge
2255 cneg x6, x6, ge
2256 csel x4, x5, x4, ge
2257 add x5, x5, x6
2258 add x1, x1, #0x2
2259 tst x5, #0x2
2260 asr x5, x5, #1
2261 csel x6, x4, xzr, ne
2262 ccmp x1, xzr, #0x8, ne
2263 cneg x1, x1, ge
2264 cneg x6, x6, ge
2265 csel x4, x5, x4, ge
2266 add x5, x5, x6
2267 add x1, x1, #0x2
2268 tst x5, #0x2
2269 asr x5, x5, #1
2270 csel x6, x4, xzr, ne
2271 ccmp x1, xzr, #0x8, ne
2272 cneg x1, x1, ge
2273 cneg x6, x6, ge
2274 csel x4, x5, x4, ge
2275 add x5, x5, x6
2276 add x1, x1, #0x2
2277 tst x5, #0x2
2278 asr x5, x5, #1
2279 csel x6, x4, xzr, ne
2280 ccmp x1, xzr, #0x8, ne
2281 cneg x1, x1, ge
2282 cneg x6, x6, ge
2283 csel x4, x5, x4, ge
2284 add x5, x5, x6
2285 add x1, x1, #0x2
2286 tst x5, #0x2
2287 asr x5, x5, #1
2288 mul x2, x12, x8
2289 mul x3, x12, x9
2290 mul x6, x14, x8
2291 mul x7, x14, x9
2292 madd x8, x13, x10, x2
2293 madd x9, x13, x11, x3
2294 madd x16, x15, x10, x6
2295 madd x17, x15, x11, x7
2296 csel x6, x4, xzr, ne
2297 ccmp x1, xzr, #0x8, ne
2298 cneg x1, x1, ge
2299 cneg x6, x6, ge
2300 csel x4, x5, x4, ge
2301 add x5, x5, x6
2302 add x1, x1, #0x2
2303 tst x5, #0x2
2304 asr x5, x5, #1
2305 csel x6, x4, xzr, ne
2306 ccmp x1, xzr, #0x8, ne
2307 cneg x1, x1, ge
2308 cneg x6, x6, ge
2309 csel x4, x5, x4, ge
2310 add x5, x5, x6
2311 add x1, x1, #0x2
2312 tst x5, #0x2
2313 asr x5, x5, #1
2314 csel x6, x4, xzr, ne
2315 ccmp x1, xzr, #0x8, ne
2316 cneg x1, x1, ge
2317 cneg x6, x6, ge
2318 csel x4, x5, x4, ge
2319 add x5, x5, x6
2320 add x1, x1, #0x2
2321 tst x5, #0x2
2322 asr x5, x5, #1
2323 csel x6, x4, xzr, ne
2324 ccmp x1, xzr, #0x8, ne
2325 cneg x1, x1, ge
2326 cneg x6, x6, ge
2327 csel x4, x5, x4, ge
2328 add x5, x5, x6
2329 add x1, x1, #0x2
2330 tst x5, #0x2
2331 asr x5, x5, #1
2332 csel x6, x4, xzr, ne
2333 ccmp x1, xzr, #0x8, ne
2334 cneg x1, x1, ge
2335 cneg x6, x6, ge
2336 csel x4, x5, x4, ge
2337 add x5, x5, x6
2338 add x1, x1, #0x2
2339 tst x5, #0x2
2340 asr x5, x5, #1
2341 csel x6, x4, xzr, ne
2342 ccmp x1, xzr, #0x8, ne
2343 cneg x1, x1, ge
2344 cneg x6, x6, ge
2345 csel x4, x5, x4, ge
2346 add x5, x5, x6
2347 add x1, x1, #0x2
2348 tst x5, #0x2
2349 asr x5, x5, #1
2350 csel x6, x4, xzr, ne
2351 ccmp x1, xzr, #0x8, ne
2352 cneg x1, x1, ge
2353 cneg x6, x6, ge
2354 csel x4, x5, x4, ge
2355 add x5, x5, x6
2356 add x1, x1, #0x2
2357 tst x5, #0x2
2358 asr x5, x5, #1
2359 csel x6, x4, xzr, ne
2360 ccmp x1, xzr, #0x8, ne
2361 cneg x1, x1, ge
2362 cneg x6, x6, ge
2363 csel x4, x5, x4, ge
2364 add x5, x5, x6
2365 add x1, x1, #0x2
2366 tst x5, #0x2
2367 asr x5, x5, #1
2368 csel x6, x4, xzr, ne
2369 ccmp x1, xzr, #0x8, ne
2370 cneg x1, x1, ge
2371 cneg x6, x6, ge
2372 csel x4, x5, x4, ge
2373 add x5, x5, x6
2374 add x1, x1, #0x2
2375 asr x5, x5, #1
2376 add x12, x4, #0x100, lsl #12
2377 sbfx x12, x12, #22, #21
2378 mov x15, #0x100000
2379 add x15, x15, x15, lsl #21
2380 add x13, x4, x15
2381 asr x13, x13, #43
2382 add x14, x5, #0x100, lsl #12
2383 sbfx x14, x14, #22, #21
2384 add x15, x5, x15
2385 asr x15, x15, #43
2386 mneg x2, x12, x8
2387 mneg x3, x12, x9
2388 mneg x4, x14, x8
2389 mneg x5, x14, x9
2390 msub x10, x13, x16, x2
2391 msub x11, x13, x17, x3
2392 msub x12, x15, x16, x4
2393 msub x13, x15, x17, x5
2394 mov x22, x1
2395 subs x21, x21, #0x1
2396 b.ne curve25519_x25519_byte_invloop
2397 ldr x0, [sp]
2398 ldr x1, [sp, #32]
2399 mul x0, x0, x10
2400 madd x1, x1, x11, x0
2401 asr x0, x1, #63
2402 cmp x10, xzr
2403 csetm x14, mi
2404 cneg x10, x10, mi
2405 eor x14, x14, x0
2406 cmp x11, xzr
2407 csetm x15, mi
2408 cneg x11, x11, mi
2409 eor x15, x15, x0
2410 cmp x12, xzr
2411 csetm x16, mi
2412 cneg x12, x12, mi
2413 eor x16, x16, x0
2414 cmp x13, xzr
2415 csetm x17, mi
2416 cneg x13, x13, mi
2417 eor x17, x17, x0
2418 and x0, x10, x14
2419 and x1, x11, x15
2420 add x9, x0, x1
2421 ldr x7, [sp, #64]
2422 eor x1, x7, x14
2423 mul x0, x1, x10
2424 umulh x1, x1, x10
2425 adds x4, x9, x0
2426 adc x2, xzr, x1
2427 ldr x8, [sp, #96]
2428 eor x1, x8, x15
2429 mul x0, x1, x11
2430 umulh x1, x1, x11
2431 adds x4, x4, x0
2432 str x4, [sp, #64]
2433 adc x2, x2, x1
2434 ldr x7, [sp, #72]
2435 eor x1, x7, x14
2436 mul x0, x1, x10
2437 umulh x1, x1, x10
2438 adds x2, x2, x0
2439 adc x6, xzr, x1
2440 ldr x8, [sp, #104]
2441 eor x1, x8, x15
2442 mul x0, x1, x11
2443 umulh x1, x1, x11
2444 adds x2, x2, x0
2445 str x2, [sp, #72]
2446 adc x6, x6, x1
2447 ldr x7, [sp, #80]
2448 eor x1, x7, x14
2449 mul x0, x1, x10
2450 umulh x1, x1, x10
2451 adds x6, x6, x0
2452 adc x5, xzr, x1
2453 ldr x8, [sp, #112]
2454 eor x1, x8, x15
2455 mul x0, x1, x11
2456 umulh x1, x1, x11
2457 adds x6, x6, x0
2458 str x6, [sp, #80]
2459 adc x5, x5, x1
2460 ldr x7, [sp, #88]
2461 eor x1, x7, x14
2462 and x3, x14, x10
2463 neg x3, x3
2464 mul x0, x1, x10
2465 umulh x1, x1, x10
2466 adds x5, x5, x0
2467 adc x3, x3, x1
2468 ldr x8, [sp, #120]
2469 eor x1, x8, x15
2470 and x0, x15, x11
2471 sub x3, x3, x0
2472 mul x0, x1, x11
2473 umulh x1, x1, x11
2474 adds x5, x5, x0
2475 adc x3, x3, x1
2476 extr x6, x3, x5, #63
2477 ldp x0, x1, [sp, #64]
2478 tst x3, x3
2479 cinc x6, x6, pl
2480 mov x3, #0x13
2481 mul x4, x6, x3
2482 add x5, x5, x6, lsl #63
2483 smulh x6, x6, x3
2484 ldr x2, [sp, #80]
2485 adds x0, x0, x4
2486 adcs x1, x1, x6
2487 asr x6, x6, #63
2488 adcs x2, x2, x6
2489 adcs x5, x5, x6
2490 csel x3, x3, xzr, mi
2491 subs x0, x0, x3
2492 sbcs x1, x1, xzr
2493 sbcs x2, x2, xzr
2494 sbc x5, x5, xzr
2495 and x5, x5, #0x7fffffffffffffff
2496 mov x4, x20
2497 stp x0, x1, [x4]
2498 stp x2, x5, [x4, #16]
2499
2500 // Now the result is xn * (1/zn), fully reduced modulo p.
2501 // Note that in the degenerate case zn = 0 (mod p_25519), the
2502 // modular inverse code above will produce 1/zn = 0, giving
2503 // the correct overall X25519 result of zero for the point at
2504 // infinity. The multiplication below is just an inlined
2505 // version of bignum_mul_p25519 except for the detailed
2506 // addressing of inputs and outputs
2507
2508 ldp x3, x4, [xn]
2509 ldp x5, x6, [zn]
2510 umull x7, w3, w5
2511 lsr x0, x3, #32
2512 umull x15, w0, w5
2513 lsr x16, x5, #32
2514 umull x8, w16, w0
2515 umull x16, w3, w16
2516 adds x7, x7, x15, lsl #32
2517 lsr x15, x15, #32
2518 adc x8, x8, x15
2519 adds x7, x7, x16, lsl #32
2520 lsr x16, x16, #32
2521 adc x8, x8, x16
2522 mul x9, x4, x6
2523 umulh x10, x4, x6
2524 subs x4, x4, x3
2525 cneg x4, x4, cc
2526 csetm x16, cc
2527 adds x9, x9, x8
2528 adc x10, x10, xzr
2529 subs x3, x5, x6
2530 cneg x3, x3, cc
2531 cinv x16, x16, cc
2532 mul x15, x4, x3
2533 umulh x3, x4, x3
2534 adds x8, x7, x9
2535 adcs x9, x9, x10
2536 adc x10, x10, xzr
2537 cmn x16, #0x1
2538 eor x15, x15, x16
2539 adcs x8, x15, x8
2540 eor x3, x3, x16
2541 adcs x9, x3, x9
2542 adc x10, x10, x16
2543 ldp x3, x4, [xn+16]
2544 ldp x5, x6, [zn+16]
2545 umull x11, w3, w5
2546 lsr x0, x3, #32
2547 umull x15, w0, w5
2548 lsr x16, x5, #32
2549 umull x12, w16, w0
2550 umull x16, w3, w16
2551 adds x11, x11, x15, lsl #32
2552 lsr x15, x15, #32
2553 adc x12, x12, x15
2554 adds x11, x11, x16, lsl #32
2555 lsr x16, x16, #32
2556 adc x12, x12, x16
2557 mul x13, x4, x6
2558 umulh x14, x4, x6
2559 subs x4, x4, x3
2560 cneg x4, x4, cc
2561 csetm x16, cc
2562 adds x13, x13, x12
2563 adc x14, x14, xzr
2564 subs x3, x5, x6
2565 cneg x3, x3, cc
2566 cinv x16, x16, cc
2567 mul x15, x4, x3
2568 umulh x3, x4, x3
2569 adds x12, x11, x13
2570 adcs x13, x13, x14
2571 adc x14, x14, xzr
2572 cmn x16, #0x1
2573 eor x15, x15, x16
2574 adcs x12, x15, x12
2575 eor x3, x3, x16
2576 adcs x13, x3, x13
2577 adc x14, x14, x16
2578 ldp x3, x4, [xn+16]
2579 ldp x15, x16, [xn]
2580 subs x3, x3, x15
2581 sbcs x4, x4, x16
2582 csetm x16, cc
2583 ldp x15, x0, [zn]
2584 subs x5, x15, x5
2585 sbcs x6, x0, x6
2586 csetm x0, cc
2587 eor x3, x3, x16
2588 subs x3, x3, x16
2589 eor x4, x4, x16
2590 sbc x4, x4, x16
2591 eor x5, x5, x0
2592 subs x5, x5, x0
2593 eor x6, x6, x0
2594 sbc x6, x6, x0
2595 eor x16, x0, x16
2596 adds x11, x11, x9
2597 adcs x12, x12, x10
2598 adcs x13, x13, xzr
2599 adc x14, x14, xzr
2600 mul x2, x3, x5
2601 umulh x0, x3, x5
2602 mul x15, x4, x6
2603 umulh x1, x4, x6
2604 subs x4, x4, x3
2605 cneg x4, x4, cc
2606 csetm x9, cc
2607 adds x15, x15, x0
2608 adc x1, x1, xzr
2609 subs x6, x5, x6
2610 cneg x6, x6, cc
2611 cinv x9, x9, cc
2612 mul x5, x4, x6
2613 umulh x6, x4, x6
2614 adds x0, x2, x15
2615 adcs x15, x15, x1
2616 adc x1, x1, xzr
2617 cmn x9, #0x1
2618 eor x5, x5, x9
2619 adcs x0, x5, x0
2620 eor x6, x6, x9
2621 adcs x15, x6, x15
2622 adc x1, x1, x9
2623 adds x9, x11, x7
2624 adcs x10, x12, x8
2625 adcs x11, x13, x11
2626 adcs x12, x14, x12
2627 adcs x13, x13, xzr
2628 adc x14, x14, xzr
2629 cmn x16, #0x1
2630 eor x2, x2, x16
2631 adcs x9, x2, x9
2632 eor x0, x0, x16
2633 adcs x10, x0, x10
2634 eor x15, x15, x16
2635 adcs x11, x15, x11
2636 eor x1, x1, x16
2637 adcs x12, x1, x12
2638 adcs x13, x13, x16
2639 adc x14, x14, x16
2640 mov x3, #0x26
2641 umull x4, w11, w3
2642 add x4, x4, w7, uxtw
2643 lsr x7, x7, #32
2644 lsr x11, x11, #32
2645 umaddl x11, w11, w3, x7
2646 mov x7, x4
2647 umull x4, w12, w3
2648 add x4, x4, w8, uxtw
2649 lsr x8, x8, #32
2650 lsr x12, x12, #32
2651 umaddl x12, w12, w3, x8
2652 mov x8, x4
2653 umull x4, w13, w3
2654 add x4, x4, w9, uxtw
2655 lsr x9, x9, #32
2656 lsr x13, x13, #32
2657 umaddl x13, w13, w3, x9
2658 mov x9, x4
2659 umull x4, w14, w3
2660 add x4, x4, w10, uxtw
2661 lsr x10, x10, #32
2662 lsr x14, x14, #32
2663 umaddl x14, w14, w3, x10
2664 mov x10, x4
2665 lsr x0, x14, #31
2666 mov x5, #0x13
2667 umaddl x5, w5, w0, x5
2668 add x7, x7, x5
2669 adds x7, x7, x11, lsl #32
2670 extr x3, x12, x11, #32
2671 adcs x8, x8, x3
2672 extr x3, x13, x12, #32
2673 adcs x9, x9, x3
2674 extr x3, x14, x13, #32
2675 lsl x5, x0, #63
2676 eor x10, x10, x5
2677 adc x10, x10, x3
2678 mov x3, #0x13
2679 tst x10, #0x8000000000000000
2680 csel x3, x3, xzr, pl
2681 subs x7, x7, x3
2682 sbcs x8, x8, xzr
2683 sbcs x9, x9, xzr
2684 sbc x10, x10, xzr
2685 and x10, x10, #0x7fffffffffffffff
2686 stp x7, x8, [zn]
2687 stp x9, x10, [zn+16]
2688
2689 // Now copy bytewise to the output
2690
2691 ldr x17, [res]
2692
2693 ldp x10, x11, [zn]
2694 strb w10, [x17]
2695 lsr x10, x10, #8
2696 strb w10, [x17, #1]
2697 lsr x10, x10, #8
2698 strb w10, [x17, #2]
2699 lsr x10, x10, #8
2700 strb w10, [x17, #3]
2701 lsr x10, x10, #8
2702 strb w10, [x17, #4]
2703 lsr x10, x10, #8
2704 strb w10, [x17, #5]
2705 lsr x10, x10, #8
2706 strb w10, [x17, #6]
2707 lsr x10, x10, #8
2708 strb w10, [x17, #7]
2709
2710 strb w11, [x17, #8]
2711 lsr x11, x11, #8
2712 strb w11, [x17, #9]
2713 lsr x11, x11, #8
2714 strb w11, [x17, #10]
2715 lsr x11, x11, #8
2716 strb w11, [x17, #11]
2717 lsr x11, x11, #8
2718 strb w11, [x17, #12]
2719 lsr x11, x11, #8
2720 strb w11, [x17, #13]
2721 lsr x11, x11, #8
2722 strb w11, [x17, #14]
2723 lsr x11, x11, #8
2724 strb w11, [x17, #15]
2725
2726 ldp x12, x13, [zn+16]
2727 strb w12, [x17, #16]
2728 lsr x12, x12, #8
2729 strb w12, [x17, #17]
2730 lsr x12, x12, #8
2731 strb w12, [x17, #18]
2732 lsr x12, x12, #8
2733 strb w12, [x17, #19]
2734 lsr x12, x12, #8
2735 strb w12, [x17, #20]
2736 lsr x12, x12, #8
2737 strb w12, [x17, #21]
2738 lsr x12, x12, #8
2739 strb w12, [x17, #22]
2740 lsr x12, x12, #8
2741 strb w12, [x17, #23]
2742
2743 strb w13, [x17, #24]
2744 lsr x13, x13, #8
2745 strb w13, [x17, #25]
2746 lsr x13, x13, #8
2747 strb w13, [x17, #26]
2748 lsr x13, x13, #8
2749 strb w13, [x17, #27]
2750 lsr x13, x13, #8
2751 strb w13, [x17, #28]
2752 lsr x13, x13, #8
2753 strb w13, [x17, #29]
2754 lsr x13, x13, #8
2755 strb w13, [x17, #30]
2756 lsr x13, x13, #8
2757 strb w13, [x17, #31]
2758
2759 // Restore stack and registers (this will zero the tops of Q8...Q15).
2760
2761 ldp d8, d9, [regsave+0]
2762 ldp d10, d11, [regsave+16]
2763 ldp d12, d13, [regsave+32]
2764 ldp d14, d15, [regsave+48]
2765 ldp x19, x20, [regsave+64]
2766 ldp x21, x22, [regsave+80]
2767 ldp x23, x24, [regsave+96]
2768 ldp x25, x26, [regsave+112]
2769 ldp x27, x28, [regsave+128]
2770 ldp x29, x30, [regsave+144]
2771 add sp, sp, #NSPACE+160
2772 ret
2773
2774 #if defined(__linux__) && defined(__ELF__)
2775 .section .note.GNU-stack, "", %progbits
2776 #endif