VirtualBox

source: vbox/trunk/src/libs/openssl-1.1.1k/crypto/genasm-macosx/vpaes-x86.S@ 91789

最後變更 在這個檔案從91789是 83531,由 vboxsync 提交於 5 年 前

setting svn:sync-process=export for openssl-1.1.1f, all files except tests

檔案大小: 13.6 KB
 
1.text
2.align 6,0x90
3L_vpaes_consts:
4.long 218628480,235210255,168496130,67568393
5.long 252381056,17041926,33884169,51187212
6.long 252645135,252645135,252645135,252645135
7.long 1512730624,3266504856,1377990664,3401244816
8.long 830229760,1275146365,2969422977,3447763452
9.long 3411033600,2979783055,338359620,2782886510
10.long 4209124096,907596821,221174255,1006095553
11.long 191964160,3799684038,3164090317,1589111125
12.long 182528256,1777043520,2877432650,3265356744
13.long 1874708224,3503451415,3305285752,363511674
14.long 1606117888,3487855781,1093350906,2384367825
15.long 197121,67569157,134941193,202313229
16.long 67569157,134941193,202313229,197121
17.long 134941193,202313229,197121,67569157
18.long 202313229,197121,67569157,134941193
19.long 33619971,100992007,168364043,235736079
20.long 235736079,33619971,100992007,168364043
21.long 168364043,235736079,33619971,100992007
22.long 100992007,168364043,235736079,33619971
23.long 50462976,117835012,185207048,252579084
24.long 252314880,51251460,117574920,184942860
25.long 184682752,252054788,50987272,118359308
26.long 118099200,185467140,251790600,50727180
27.long 2946363062,528716217,1300004225,1881839624
28.long 1532713819,1532713819,1532713819,1532713819
29.long 3602276352,4288629033,3737020424,4153884961
30.long 1354558464,32357713,2958822624,3775749553
31.long 1201988352,132424512,1572796698,503232858
32.long 2213177600,1597421020,4103937655,675398315
33.long 2749646592,4273543773,1511898873,121693092
34.long 3040248576,1103263732,2871565598,1608280554
35.long 2236667136,2588920351,482954393,64377734
36.long 3069987328,291237287,2117370568,3650299247
37.long 533321216,3573750986,2572112006,1401264716
38.long 1339849704,2721158661,548607111,3445553514
39.long 2128193280,3054596040,2183486460,1257083700
40.long 655635200,1165381986,3923443150,2344132524
41.long 190078720,256924420,290342170,357187870
42.long 1610966272,2263057382,4103205268,309794674
43.long 2592527872,2233205587,1335446729,3402964816
44.long 3973531904,3225098121,3002836325,1918774430
45.long 3870401024,2102906079,2284471353,4117666579
46.long 617007872,1021508343,366931923,691083277
47.long 2528395776,3491914898,2968704004,1613121270
48.long 3445188352,3247741094,844474987,4093578302
49.long 651481088,1190302358,1689581232,574775300
50.long 4289380608,206939853,2555985458,2489840491
51.long 2130264064,327674451,3566485037,3349835193
52.long 2470714624,316102159,3636825756,3393945945
53.byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
54.byte 111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83
55.byte 83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117
56.byte 114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105
57.byte 118,101,114,115,105,116,121,41,0
58.align 6,0x90
59.align 4
60__vpaes_preheat:
61 addl (%esp),%ebp
62 movdqa -48(%ebp),%xmm7
63 movdqa -16(%ebp),%xmm6
64 ret
65.align 4
66__vpaes_encrypt_core:
67 movl $16,%ecx
68 movl 240(%edx),%eax
69 movdqa %xmm6,%xmm1
70 movdqa (%ebp),%xmm2
71 pandn %xmm0,%xmm1
72 pand %xmm6,%xmm0
73 movdqu (%edx),%xmm5
74.byte 102,15,56,0,208
75 movdqa 16(%ebp),%xmm0
76 pxor %xmm5,%xmm2
77 psrld $4,%xmm1
78 addl $16,%edx
79.byte 102,15,56,0,193
80 leal 192(%ebp),%ebx
81 pxor %xmm2,%xmm0
82 jmp L000enc_entry
83.align 4,0x90
84L001enc_loop:
85 movdqa 32(%ebp),%xmm4
86 movdqa 48(%ebp),%xmm0
87.byte 102,15,56,0,226
88.byte 102,15,56,0,195
89 pxor %xmm5,%xmm4
90 movdqa 64(%ebp),%xmm5
91 pxor %xmm4,%xmm0
92 movdqa -64(%ebx,%ecx,1),%xmm1
93.byte 102,15,56,0,234
94 movdqa 80(%ebp),%xmm2
95 movdqa (%ebx,%ecx,1),%xmm4
96.byte 102,15,56,0,211
97 movdqa %xmm0,%xmm3
98 pxor %xmm5,%xmm2
99.byte 102,15,56,0,193
100 addl $16,%edx
101 pxor %xmm2,%xmm0
102.byte 102,15,56,0,220
103 addl $16,%ecx
104 pxor %xmm0,%xmm3
105.byte 102,15,56,0,193
106 andl $48,%ecx
107 subl $1,%eax
108 pxor %xmm3,%xmm0
109L000enc_entry:
110 movdqa %xmm6,%xmm1
111 movdqa -32(%ebp),%xmm5
112 pandn %xmm0,%xmm1
113 psrld $4,%xmm1
114 pand %xmm6,%xmm0
115.byte 102,15,56,0,232
116 movdqa %xmm7,%xmm3
117 pxor %xmm1,%xmm0
118.byte 102,15,56,0,217
119 movdqa %xmm7,%xmm4
120 pxor %xmm5,%xmm3
121.byte 102,15,56,0,224
122 movdqa %xmm7,%xmm2
123 pxor %xmm5,%xmm4
124.byte 102,15,56,0,211
125 movdqa %xmm7,%xmm3
126 pxor %xmm0,%xmm2
127.byte 102,15,56,0,220
128 movdqu (%edx),%xmm5
129 pxor %xmm1,%xmm3
130 jnz L001enc_loop
131 movdqa 96(%ebp),%xmm4
132 movdqa 112(%ebp),%xmm0
133.byte 102,15,56,0,226
134 pxor %xmm5,%xmm4
135.byte 102,15,56,0,195
136 movdqa 64(%ebx,%ecx,1),%xmm1
137 pxor %xmm4,%xmm0
138.byte 102,15,56,0,193
139 ret
140.align 4
141__vpaes_decrypt_core:
142 leal 608(%ebp),%ebx
143 movl 240(%edx),%eax
144 movdqa %xmm6,%xmm1
145 movdqa -64(%ebx),%xmm2
146 pandn %xmm0,%xmm1
147 movl %eax,%ecx
148 psrld $4,%xmm1
149 movdqu (%edx),%xmm5
150 shll $4,%ecx
151 pand %xmm6,%xmm0
152.byte 102,15,56,0,208
153 movdqa -48(%ebx),%xmm0
154 xorl $48,%ecx
155.byte 102,15,56,0,193
156 andl $48,%ecx
157 pxor %xmm5,%xmm2
158 movdqa 176(%ebp),%xmm5
159 pxor %xmm2,%xmm0
160 addl $16,%edx
161 leal -352(%ebx,%ecx,1),%ecx
162 jmp L002dec_entry
163.align 4,0x90
164L003dec_loop:
165 movdqa -32(%ebx),%xmm4
166 movdqa -16(%ebx),%xmm1
167.byte 102,15,56,0,226
168.byte 102,15,56,0,203
169 pxor %xmm4,%xmm0
170 movdqa (%ebx),%xmm4
171 pxor %xmm1,%xmm0
172 movdqa 16(%ebx),%xmm1
173.byte 102,15,56,0,226
174.byte 102,15,56,0,197
175.byte 102,15,56,0,203
176 pxor %xmm4,%xmm0
177 movdqa 32(%ebx),%xmm4
178 pxor %xmm1,%xmm0
179 movdqa 48(%ebx),%xmm1
180.byte 102,15,56,0,226
181.byte 102,15,56,0,197
182.byte 102,15,56,0,203
183 pxor %xmm4,%xmm0
184 movdqa 64(%ebx),%xmm4
185 pxor %xmm1,%xmm0
186 movdqa 80(%ebx),%xmm1
187.byte 102,15,56,0,226
188.byte 102,15,56,0,197
189.byte 102,15,56,0,203
190 pxor %xmm4,%xmm0
191 addl $16,%edx
192.byte 102,15,58,15,237,12
193 pxor %xmm1,%xmm0
194 subl $1,%eax
195L002dec_entry:
196 movdqa %xmm6,%xmm1
197 movdqa -32(%ebp),%xmm2
198 pandn %xmm0,%xmm1
199 pand %xmm6,%xmm0
200 psrld $4,%xmm1
201.byte 102,15,56,0,208
202 movdqa %xmm7,%xmm3
203 pxor %xmm1,%xmm0
204.byte 102,15,56,0,217
205 movdqa %xmm7,%xmm4
206 pxor %xmm2,%xmm3
207.byte 102,15,56,0,224
208 pxor %xmm2,%xmm4
209 movdqa %xmm7,%xmm2
210.byte 102,15,56,0,211
211 movdqa %xmm7,%xmm3
212 pxor %xmm0,%xmm2
213.byte 102,15,56,0,220
214 movdqu (%edx),%xmm0
215 pxor %xmm1,%xmm3
216 jnz L003dec_loop
217 movdqa 96(%ebx),%xmm4
218.byte 102,15,56,0,226
219 pxor %xmm0,%xmm4
220 movdqa 112(%ebx),%xmm0
221 movdqa (%ecx),%xmm2
222.byte 102,15,56,0,195
223 pxor %xmm4,%xmm0
224.byte 102,15,56,0,194
225 ret
226.align 4
227__vpaes_schedule_core:
228 addl (%esp),%ebp
229 movdqu (%esi),%xmm0
230 movdqa 320(%ebp),%xmm2
231 movdqa %xmm0,%xmm3
232 leal (%ebp),%ebx
233 movdqa %xmm2,4(%esp)
234 call __vpaes_schedule_transform
235 movdqa %xmm0,%xmm7
236 testl %edi,%edi
237 jnz L004schedule_am_decrypting
238 movdqu %xmm0,(%edx)
239 jmp L005schedule_go
240L004schedule_am_decrypting:
241 movdqa 256(%ebp,%ecx,1),%xmm1
242.byte 102,15,56,0,217
243 movdqu %xmm3,(%edx)
244 xorl $48,%ecx
245L005schedule_go:
246 cmpl $192,%eax
247 ja L006schedule_256
248 je L007schedule_192
249L008schedule_128:
250 movl $10,%eax
251L009loop_schedule_128:
252 call __vpaes_schedule_round
253 decl %eax
254 jz L010schedule_mangle_last
255 call __vpaes_schedule_mangle
256 jmp L009loop_schedule_128
257.align 4,0x90
258L007schedule_192:
259 movdqu 8(%esi),%xmm0
260 call __vpaes_schedule_transform
261 movdqa %xmm0,%xmm6
262 pxor %xmm4,%xmm4
263 movhlps %xmm4,%xmm6
264 movl $4,%eax
265L011loop_schedule_192:
266 call __vpaes_schedule_round
267.byte 102,15,58,15,198,8
268 call __vpaes_schedule_mangle
269 call __vpaes_schedule_192_smear
270 call __vpaes_schedule_mangle
271 call __vpaes_schedule_round
272 decl %eax
273 jz L010schedule_mangle_last
274 call __vpaes_schedule_mangle
275 call __vpaes_schedule_192_smear
276 jmp L011loop_schedule_192
277.align 4,0x90
278L006schedule_256:
279 movdqu 16(%esi),%xmm0
280 call __vpaes_schedule_transform
281 movl $7,%eax
282L012loop_schedule_256:
283 call __vpaes_schedule_mangle
284 movdqa %xmm0,%xmm6
285 call __vpaes_schedule_round
286 decl %eax
287 jz L010schedule_mangle_last
288 call __vpaes_schedule_mangle
289 pshufd $255,%xmm0,%xmm0
290 movdqa %xmm7,20(%esp)
291 movdqa %xmm6,%xmm7
292 call L_vpaes_schedule_low_round
293 movdqa 20(%esp),%xmm7
294 jmp L012loop_schedule_256
295.align 4,0x90
296L010schedule_mangle_last:
297 leal 384(%ebp),%ebx
298 testl %edi,%edi
299 jnz L013schedule_mangle_last_dec
300 movdqa 256(%ebp,%ecx,1),%xmm1
301.byte 102,15,56,0,193
302 leal 352(%ebp),%ebx
303 addl $32,%edx
304L013schedule_mangle_last_dec:
305 addl $-16,%edx
306 pxor 336(%ebp),%xmm0
307 call __vpaes_schedule_transform
308 movdqu %xmm0,(%edx)
309 pxor %xmm0,%xmm0
310 pxor %xmm1,%xmm1
311 pxor %xmm2,%xmm2
312 pxor %xmm3,%xmm3
313 pxor %xmm4,%xmm4
314 pxor %xmm5,%xmm5
315 pxor %xmm6,%xmm6
316 pxor %xmm7,%xmm7
317 ret
318.align 4
319__vpaes_schedule_192_smear:
320 pshufd $128,%xmm6,%xmm1
321 pshufd $254,%xmm7,%xmm0
322 pxor %xmm1,%xmm6
323 pxor %xmm1,%xmm1
324 pxor %xmm0,%xmm6
325 movdqa %xmm6,%xmm0
326 movhlps %xmm1,%xmm6
327 ret
328.align 4
329__vpaes_schedule_round:
330 movdqa 8(%esp),%xmm2
331 pxor %xmm1,%xmm1
332.byte 102,15,58,15,202,15
333.byte 102,15,58,15,210,15
334 pxor %xmm1,%xmm7
335 pshufd $255,%xmm0,%xmm0
336.byte 102,15,58,15,192,1
337 movdqa %xmm2,8(%esp)
338L_vpaes_schedule_low_round:
339 movdqa %xmm7,%xmm1
340 pslldq $4,%xmm7
341 pxor %xmm1,%xmm7
342 movdqa %xmm7,%xmm1
343 pslldq $8,%xmm7
344 pxor %xmm1,%xmm7
345 pxor 336(%ebp),%xmm7
346 movdqa -16(%ebp),%xmm4
347 movdqa -48(%ebp),%xmm5
348 movdqa %xmm4,%xmm1
349 pandn %xmm0,%xmm1
350 psrld $4,%xmm1
351 pand %xmm4,%xmm0
352 movdqa -32(%ebp),%xmm2
353.byte 102,15,56,0,208
354 pxor %xmm1,%xmm0
355 movdqa %xmm5,%xmm3
356.byte 102,15,56,0,217
357 pxor %xmm2,%xmm3
358 movdqa %xmm5,%xmm4
359.byte 102,15,56,0,224
360 pxor %xmm2,%xmm4
361 movdqa %xmm5,%xmm2
362.byte 102,15,56,0,211
363 pxor %xmm0,%xmm2
364 movdqa %xmm5,%xmm3
365.byte 102,15,56,0,220
366 pxor %xmm1,%xmm3
367 movdqa 32(%ebp),%xmm4
368.byte 102,15,56,0,226
369 movdqa 48(%ebp),%xmm0
370.byte 102,15,56,0,195
371 pxor %xmm4,%xmm0
372 pxor %xmm7,%xmm0
373 movdqa %xmm0,%xmm7
374 ret
375.align 4
376__vpaes_schedule_transform:
377 movdqa -16(%ebp),%xmm2
378 movdqa %xmm2,%xmm1
379 pandn %xmm0,%xmm1
380 psrld $4,%xmm1
381 pand %xmm2,%xmm0
382 movdqa (%ebx),%xmm2
383.byte 102,15,56,0,208
384 movdqa 16(%ebx),%xmm0
385.byte 102,15,56,0,193
386 pxor %xmm2,%xmm0
387 ret
388.align 4
389__vpaes_schedule_mangle:
390 movdqa %xmm0,%xmm4
391 movdqa 128(%ebp),%xmm5
392 testl %edi,%edi
393 jnz L014schedule_mangle_dec
394 addl $16,%edx
395 pxor 336(%ebp),%xmm4
396.byte 102,15,56,0,229
397 movdqa %xmm4,%xmm3
398.byte 102,15,56,0,229
399 pxor %xmm4,%xmm3
400.byte 102,15,56,0,229
401 pxor %xmm4,%xmm3
402 jmp L015schedule_mangle_both
403.align 4,0x90
404L014schedule_mangle_dec:
405 movdqa -16(%ebp),%xmm2
406 leal 416(%ebp),%esi
407 movdqa %xmm2,%xmm1
408 pandn %xmm4,%xmm1
409 psrld $4,%xmm1
410 pand %xmm2,%xmm4
411 movdqa (%esi),%xmm2
412.byte 102,15,56,0,212
413 movdqa 16(%esi),%xmm3
414.byte 102,15,56,0,217
415 pxor %xmm2,%xmm3
416.byte 102,15,56,0,221
417 movdqa 32(%esi),%xmm2
418.byte 102,15,56,0,212
419 pxor %xmm3,%xmm2
420 movdqa 48(%esi),%xmm3
421.byte 102,15,56,0,217
422 pxor %xmm2,%xmm3
423.byte 102,15,56,0,221
424 movdqa 64(%esi),%xmm2
425.byte 102,15,56,0,212
426 pxor %xmm3,%xmm2
427 movdqa 80(%esi),%xmm3
428.byte 102,15,56,0,217
429 pxor %xmm2,%xmm3
430.byte 102,15,56,0,221
431 movdqa 96(%esi),%xmm2
432.byte 102,15,56,0,212
433 pxor %xmm3,%xmm2
434 movdqa 112(%esi),%xmm3
435.byte 102,15,56,0,217
436 pxor %xmm2,%xmm3
437 addl $-16,%edx
438L015schedule_mangle_both:
439 movdqa 256(%ebp,%ecx,1),%xmm1
440.byte 102,15,56,0,217
441 addl $-16,%ecx
442 andl $48,%ecx
443 movdqu %xmm3,(%edx)
444 ret
445.globl _vpaes_set_encrypt_key
446.align 4
447_vpaes_set_encrypt_key:
448L_vpaes_set_encrypt_key_begin:
449 pushl %ebp
450 pushl %ebx
451 pushl %esi
452 pushl %edi
453 movl 20(%esp),%esi
454 leal -56(%esp),%ebx
455 movl 24(%esp),%eax
456 andl $-16,%ebx
457 movl 28(%esp),%edx
458 xchgl %esp,%ebx
459 movl %ebx,48(%esp)
460 movl %eax,%ebx
461 shrl $5,%ebx
462 addl $5,%ebx
463 movl %ebx,240(%edx)
464 movl $48,%ecx
465 movl $0,%edi
466 leal L_vpaes_consts+0x30-L016pic_point,%ebp
467 call __vpaes_schedule_core
468L016pic_point:
469 movl 48(%esp),%esp
470 xorl %eax,%eax
471 popl %edi
472 popl %esi
473 popl %ebx
474 popl %ebp
475 ret
476.globl _vpaes_set_decrypt_key
477.align 4
478_vpaes_set_decrypt_key:
479L_vpaes_set_decrypt_key_begin:
480 pushl %ebp
481 pushl %ebx
482 pushl %esi
483 pushl %edi
484 movl 20(%esp),%esi
485 leal -56(%esp),%ebx
486 movl 24(%esp),%eax
487 andl $-16,%ebx
488 movl 28(%esp),%edx
489 xchgl %esp,%ebx
490 movl %ebx,48(%esp)
491 movl %eax,%ebx
492 shrl $5,%ebx
493 addl $5,%ebx
494 movl %ebx,240(%edx)
495 shll $4,%ebx
496 leal 16(%edx,%ebx,1),%edx
497 movl $1,%edi
498 movl %eax,%ecx
499 shrl $1,%ecx
500 andl $32,%ecx
501 xorl $32,%ecx
502 leal L_vpaes_consts+0x30-L017pic_point,%ebp
503 call __vpaes_schedule_core
504L017pic_point:
505 movl 48(%esp),%esp
506 xorl %eax,%eax
507 popl %edi
508 popl %esi
509 popl %ebx
510 popl %ebp
511 ret
512.globl _vpaes_encrypt
513.align 4
514_vpaes_encrypt:
515L_vpaes_encrypt_begin:
516 pushl %ebp
517 pushl %ebx
518 pushl %esi
519 pushl %edi
520 leal L_vpaes_consts+0x30-L018pic_point,%ebp
521 call __vpaes_preheat
522L018pic_point:
523 movl 20(%esp),%esi
524 leal -56(%esp),%ebx
525 movl 24(%esp),%edi
526 andl $-16,%ebx
527 movl 28(%esp),%edx
528 xchgl %esp,%ebx
529 movl %ebx,48(%esp)
530 movdqu (%esi),%xmm0
531 call __vpaes_encrypt_core
532 movdqu %xmm0,(%edi)
533 movl 48(%esp),%esp
534 popl %edi
535 popl %esi
536 popl %ebx
537 popl %ebp
538 ret
539.globl _vpaes_decrypt
540.align 4
541_vpaes_decrypt:
542L_vpaes_decrypt_begin:
543 pushl %ebp
544 pushl %ebx
545 pushl %esi
546 pushl %edi
547 leal L_vpaes_consts+0x30-L019pic_point,%ebp
548 call __vpaes_preheat
549L019pic_point:
550 movl 20(%esp),%esi
551 leal -56(%esp),%ebx
552 movl 24(%esp),%edi
553 andl $-16,%ebx
554 movl 28(%esp),%edx
555 xchgl %esp,%ebx
556 movl %ebx,48(%esp)
557 movdqu (%esi),%xmm0
558 call __vpaes_decrypt_core
559 movdqu %xmm0,(%edi)
560 movl 48(%esp),%esp
561 popl %edi
562 popl %esi
563 popl %ebx
564 popl %ebp
565 ret
566.globl _vpaes_cbc_encrypt
567.align 4
568_vpaes_cbc_encrypt:
569L_vpaes_cbc_encrypt_begin:
570 pushl %ebp
571 pushl %ebx
572 pushl %esi
573 pushl %edi
574 movl 20(%esp),%esi
575 movl 24(%esp),%edi
576 movl 28(%esp),%eax
577 movl 32(%esp),%edx
578 subl $16,%eax
579 jc L020cbc_abort
580 leal -56(%esp),%ebx
581 movl 36(%esp),%ebp
582 andl $-16,%ebx
583 movl 40(%esp),%ecx
584 xchgl %esp,%ebx
585 movdqu (%ebp),%xmm1
586 subl %esi,%edi
587 movl %ebx,48(%esp)
588 movl %edi,(%esp)
589 movl %edx,4(%esp)
590 movl %ebp,8(%esp)
591 movl %eax,%edi
592 leal L_vpaes_consts+0x30-L021pic_point,%ebp
593 call __vpaes_preheat
594L021pic_point:
595 cmpl $0,%ecx
596 je L022cbc_dec_loop
597 jmp L023cbc_enc_loop
598.align 4,0x90
599L023cbc_enc_loop:
600 movdqu (%esi),%xmm0
601 pxor %xmm1,%xmm0
602 call __vpaes_encrypt_core
603 movl (%esp),%ebx
604 movl 4(%esp),%edx
605 movdqa %xmm0,%xmm1
606 movdqu %xmm0,(%ebx,%esi,1)
607 leal 16(%esi),%esi
608 subl $16,%edi
609 jnc L023cbc_enc_loop
610 jmp L024cbc_done
611.align 4,0x90
612L022cbc_dec_loop:
613 movdqu (%esi),%xmm0
614 movdqa %xmm1,16(%esp)
615 movdqa %xmm0,32(%esp)
616 call __vpaes_decrypt_core
617 movl (%esp),%ebx
618 movl 4(%esp),%edx
619 pxor 16(%esp),%xmm0
620 movdqa 32(%esp),%xmm1
621 movdqu %xmm0,(%ebx,%esi,1)
622 leal 16(%esi),%esi
623 subl $16,%edi
624 jnc L022cbc_dec_loop
625L024cbc_done:
626 movl 8(%esp),%ebx
627 movl 48(%esp),%esp
628 movdqu %xmm1,(%ebx)
629L020cbc_abort:
630 popl %edi
631 popl %esi
632 popl %ebx
633 popl %ebp
634 ret
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette