1 | default rel
|
---|
2 | %define XMMWORD
|
---|
3 | %define YMMWORD
|
---|
4 | %define ZMMWORD
|
---|
5 | section .text code align=64
|
---|
6 |
|
---|
7 |
|
---|
8 | EXTERN OPENSSL_ia32cap_P
|
---|
9 |
|
---|
10 | global aesni_multi_cbc_encrypt
|
---|
11 |
|
---|
12 | ALIGN 32
|
---|
13 | aesni_multi_cbc_encrypt:
|
---|
14 | mov QWORD[8+rsp],rdi ;WIN64 prologue
|
---|
15 | mov QWORD[16+rsp],rsi
|
---|
16 | mov rax,rsp
|
---|
17 | $L$SEH_begin_aesni_multi_cbc_encrypt:
|
---|
18 | mov rdi,rcx
|
---|
19 | mov rsi,rdx
|
---|
20 | mov rdx,r8
|
---|
21 |
|
---|
22 |
|
---|
23 |
|
---|
24 | mov rax,rsp
|
---|
25 |
|
---|
26 | push rbx
|
---|
27 |
|
---|
28 | push rbp
|
---|
29 |
|
---|
30 | push r12
|
---|
31 |
|
---|
32 | push r13
|
---|
33 |
|
---|
34 | push r14
|
---|
35 |
|
---|
36 | push r15
|
---|
37 |
|
---|
38 | lea rsp,[((-168))+rsp]
|
---|
39 | movaps XMMWORD[rsp],xmm6
|
---|
40 | movaps XMMWORD[16+rsp],xmm7
|
---|
41 | movaps XMMWORD[32+rsp],xmm8
|
---|
42 | movaps XMMWORD[48+rsp],xmm9
|
---|
43 | movaps XMMWORD[64+rsp],xmm10
|
---|
44 | movaps XMMWORD[80+rsp],xmm11
|
---|
45 | movaps XMMWORD[96+rsp],xmm12
|
---|
46 | movaps XMMWORD[(-104)+rax],xmm13
|
---|
47 | movaps XMMWORD[(-88)+rax],xmm14
|
---|
48 | movaps XMMWORD[(-72)+rax],xmm15
|
---|
49 |
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 |
|
---|
55 | sub rsp,48
|
---|
56 | and rsp,-64
|
---|
57 | mov QWORD[16+rsp],rax
|
---|
58 |
|
---|
59 |
|
---|
60 | $L$enc4x_body:
|
---|
61 | movdqu xmm12,XMMWORD[rsi]
|
---|
62 | lea rsi,[120+rsi]
|
---|
63 | lea rdi,[80+rdi]
|
---|
64 |
|
---|
65 | $L$enc4x_loop_grande:
|
---|
66 | mov DWORD[24+rsp],edx
|
---|
67 | xor edx,edx
|
---|
68 | mov ecx,DWORD[((-64))+rdi]
|
---|
69 | mov r8,QWORD[((-80))+rdi]
|
---|
70 | cmp ecx,edx
|
---|
71 | mov r12,QWORD[((-72))+rdi]
|
---|
72 | cmovg edx,ecx
|
---|
73 | test ecx,ecx
|
---|
74 | movdqu xmm2,XMMWORD[((-56))+rdi]
|
---|
75 | mov DWORD[32+rsp],ecx
|
---|
76 | cmovle r8,rsp
|
---|
77 | mov ecx,DWORD[((-24))+rdi]
|
---|
78 | mov r9,QWORD[((-40))+rdi]
|
---|
79 | cmp ecx,edx
|
---|
80 | mov r13,QWORD[((-32))+rdi]
|
---|
81 | cmovg edx,ecx
|
---|
82 | test ecx,ecx
|
---|
83 | movdqu xmm3,XMMWORD[((-16))+rdi]
|
---|
84 | mov DWORD[36+rsp],ecx
|
---|
85 | cmovle r9,rsp
|
---|
86 | mov ecx,DWORD[16+rdi]
|
---|
87 | mov r10,QWORD[rdi]
|
---|
88 | cmp ecx,edx
|
---|
89 | mov r14,QWORD[8+rdi]
|
---|
90 | cmovg edx,ecx
|
---|
91 | test ecx,ecx
|
---|
92 | movdqu xmm4,XMMWORD[24+rdi]
|
---|
93 | mov DWORD[40+rsp],ecx
|
---|
94 | cmovle r10,rsp
|
---|
95 | mov ecx,DWORD[56+rdi]
|
---|
96 | mov r11,QWORD[40+rdi]
|
---|
97 | cmp ecx,edx
|
---|
98 | mov r15,QWORD[48+rdi]
|
---|
99 | cmovg edx,ecx
|
---|
100 | test ecx,ecx
|
---|
101 | movdqu xmm5,XMMWORD[64+rdi]
|
---|
102 | mov DWORD[44+rsp],ecx
|
---|
103 | cmovle r11,rsp
|
---|
104 | test edx,edx
|
---|
105 | jz NEAR $L$enc4x_done
|
---|
106 |
|
---|
107 | movups xmm1,XMMWORD[((16-120))+rsi]
|
---|
108 | pxor xmm2,xmm12
|
---|
109 | movups xmm0,XMMWORD[((32-120))+rsi]
|
---|
110 | pxor xmm3,xmm12
|
---|
111 | mov eax,DWORD[((240-120))+rsi]
|
---|
112 | pxor xmm4,xmm12
|
---|
113 | movdqu xmm6,XMMWORD[r8]
|
---|
114 | pxor xmm5,xmm12
|
---|
115 | movdqu xmm7,XMMWORD[r9]
|
---|
116 | pxor xmm2,xmm6
|
---|
117 | movdqu xmm8,XMMWORD[r10]
|
---|
118 | pxor xmm3,xmm7
|
---|
119 | movdqu xmm9,XMMWORD[r11]
|
---|
120 | pxor xmm4,xmm8
|
---|
121 | pxor xmm5,xmm9
|
---|
122 | movdqa xmm10,XMMWORD[32+rsp]
|
---|
123 | xor rbx,rbx
|
---|
124 | jmp NEAR $L$oop_enc4x
|
---|
125 |
|
---|
126 | ALIGN 32
|
---|
127 | $L$oop_enc4x:
|
---|
128 | add rbx,16
|
---|
129 | lea rbp,[16+rsp]
|
---|
130 | mov ecx,1
|
---|
131 | sub rbp,rbx
|
---|
132 |
|
---|
133 | DB 102,15,56,220,209
|
---|
134 | prefetcht0 [31+rbx*1+r8]
|
---|
135 | prefetcht0 [31+rbx*1+r9]
|
---|
136 | DB 102,15,56,220,217
|
---|
137 | prefetcht0 [31+rbx*1+r10]
|
---|
138 | prefetcht0 [31+rbx*1+r10]
|
---|
139 | DB 102,15,56,220,225
|
---|
140 | DB 102,15,56,220,233
|
---|
141 | movups xmm1,XMMWORD[((48-120))+rsi]
|
---|
142 | cmp ecx,DWORD[32+rsp]
|
---|
143 | DB 102,15,56,220,208
|
---|
144 | DB 102,15,56,220,216
|
---|
145 | DB 102,15,56,220,224
|
---|
146 | cmovge r8,rbp
|
---|
147 | cmovg r12,rbp
|
---|
148 | DB 102,15,56,220,232
|
---|
149 | movups xmm0,XMMWORD[((-56))+rsi]
|
---|
150 | cmp ecx,DWORD[36+rsp]
|
---|
151 | DB 102,15,56,220,209
|
---|
152 | DB 102,15,56,220,217
|
---|
153 | DB 102,15,56,220,225
|
---|
154 | cmovge r9,rbp
|
---|
155 | cmovg r13,rbp
|
---|
156 | DB 102,15,56,220,233
|
---|
157 | movups xmm1,XMMWORD[((-40))+rsi]
|
---|
158 | cmp ecx,DWORD[40+rsp]
|
---|
159 | DB 102,15,56,220,208
|
---|
160 | DB 102,15,56,220,216
|
---|
161 | DB 102,15,56,220,224
|
---|
162 | cmovge r10,rbp
|
---|
163 | cmovg r14,rbp
|
---|
164 | DB 102,15,56,220,232
|
---|
165 | movups xmm0,XMMWORD[((-24))+rsi]
|
---|
166 | cmp ecx,DWORD[44+rsp]
|
---|
167 | DB 102,15,56,220,209
|
---|
168 | DB 102,15,56,220,217
|
---|
169 | DB 102,15,56,220,225
|
---|
170 | cmovge r11,rbp
|
---|
171 | cmovg r15,rbp
|
---|
172 | DB 102,15,56,220,233
|
---|
173 | movups xmm1,XMMWORD[((-8))+rsi]
|
---|
174 | movdqa xmm11,xmm10
|
---|
175 | DB 102,15,56,220,208
|
---|
176 | prefetcht0 [15+rbx*1+r12]
|
---|
177 | prefetcht0 [15+rbx*1+r13]
|
---|
178 | DB 102,15,56,220,216
|
---|
179 | prefetcht0 [15+rbx*1+r14]
|
---|
180 | prefetcht0 [15+rbx*1+r15]
|
---|
181 | DB 102,15,56,220,224
|
---|
182 | DB 102,15,56,220,232
|
---|
183 | movups xmm0,XMMWORD[((128-120))+rsi]
|
---|
184 | pxor xmm12,xmm12
|
---|
185 |
|
---|
186 | DB 102,15,56,220,209
|
---|
187 | pcmpgtd xmm11,xmm12
|
---|
188 | movdqu xmm12,XMMWORD[((-120))+rsi]
|
---|
189 | DB 102,15,56,220,217
|
---|
190 | paddd xmm10,xmm11
|
---|
191 | movdqa XMMWORD[32+rsp],xmm10
|
---|
192 | DB 102,15,56,220,225
|
---|
193 | DB 102,15,56,220,233
|
---|
194 | movups xmm1,XMMWORD[((144-120))+rsi]
|
---|
195 |
|
---|
196 | cmp eax,11
|
---|
197 |
|
---|
198 | DB 102,15,56,220,208
|
---|
199 | DB 102,15,56,220,216
|
---|
200 | DB 102,15,56,220,224
|
---|
201 | DB 102,15,56,220,232
|
---|
202 | movups xmm0,XMMWORD[((160-120))+rsi]
|
---|
203 |
|
---|
204 | jb NEAR $L$enc4x_tail
|
---|
205 |
|
---|
206 | DB 102,15,56,220,209
|
---|
207 | DB 102,15,56,220,217
|
---|
208 | DB 102,15,56,220,225
|
---|
209 | DB 102,15,56,220,233
|
---|
210 | movups xmm1,XMMWORD[((176-120))+rsi]
|
---|
211 |
|
---|
212 | DB 102,15,56,220,208
|
---|
213 | DB 102,15,56,220,216
|
---|
214 | DB 102,15,56,220,224
|
---|
215 | DB 102,15,56,220,232
|
---|
216 | movups xmm0,XMMWORD[((192-120))+rsi]
|
---|
217 |
|
---|
218 | je NEAR $L$enc4x_tail
|
---|
219 |
|
---|
220 | DB 102,15,56,220,209
|
---|
221 | DB 102,15,56,220,217
|
---|
222 | DB 102,15,56,220,225
|
---|
223 | DB 102,15,56,220,233
|
---|
224 | movups xmm1,XMMWORD[((208-120))+rsi]
|
---|
225 |
|
---|
226 | DB 102,15,56,220,208
|
---|
227 | DB 102,15,56,220,216
|
---|
228 | DB 102,15,56,220,224
|
---|
229 | DB 102,15,56,220,232
|
---|
230 | movups xmm0,XMMWORD[((224-120))+rsi]
|
---|
231 | jmp NEAR $L$enc4x_tail
|
---|
232 |
|
---|
233 | ALIGN 32
|
---|
234 | $L$enc4x_tail:
|
---|
235 | DB 102,15,56,220,209
|
---|
236 | DB 102,15,56,220,217
|
---|
237 | DB 102,15,56,220,225
|
---|
238 | DB 102,15,56,220,233
|
---|
239 | movdqu xmm6,XMMWORD[rbx*1+r8]
|
---|
240 | movdqu xmm1,XMMWORD[((16-120))+rsi]
|
---|
241 |
|
---|
242 | DB 102,15,56,221,208
|
---|
243 | movdqu xmm7,XMMWORD[rbx*1+r9]
|
---|
244 | pxor xmm6,xmm12
|
---|
245 | DB 102,15,56,221,216
|
---|
246 | movdqu xmm8,XMMWORD[rbx*1+r10]
|
---|
247 | pxor xmm7,xmm12
|
---|
248 | DB 102,15,56,221,224
|
---|
249 | movdqu xmm9,XMMWORD[rbx*1+r11]
|
---|
250 | pxor xmm8,xmm12
|
---|
251 | DB 102,15,56,221,232
|
---|
252 | movdqu xmm0,XMMWORD[((32-120))+rsi]
|
---|
253 | pxor xmm9,xmm12
|
---|
254 |
|
---|
255 | movups XMMWORD[(-16)+rbx*1+r12],xmm2
|
---|
256 | pxor xmm2,xmm6
|
---|
257 | movups XMMWORD[(-16)+rbx*1+r13],xmm3
|
---|
258 | pxor xmm3,xmm7
|
---|
259 | movups XMMWORD[(-16)+rbx*1+r14],xmm4
|
---|
260 | pxor xmm4,xmm8
|
---|
261 | movups XMMWORD[(-16)+rbx*1+r15],xmm5
|
---|
262 | pxor xmm5,xmm9
|
---|
263 |
|
---|
264 | dec edx
|
---|
265 | jnz NEAR $L$oop_enc4x
|
---|
266 |
|
---|
267 | mov rax,QWORD[16+rsp]
|
---|
268 |
|
---|
269 | mov edx,DWORD[24+rsp]
|
---|
270 |
|
---|
271 |
|
---|
272 |
|
---|
273 |
|
---|
274 |
|
---|
275 |
|
---|
276 |
|
---|
277 |
|
---|
278 |
|
---|
279 |
|
---|
280 | lea rdi,[160+rdi]
|
---|
281 | dec edx
|
---|
282 | jnz NEAR $L$enc4x_loop_grande
|
---|
283 |
|
---|
284 | $L$enc4x_done:
|
---|
285 | movaps xmm6,XMMWORD[((-216))+rax]
|
---|
286 | movaps xmm7,XMMWORD[((-200))+rax]
|
---|
287 | movaps xmm8,XMMWORD[((-184))+rax]
|
---|
288 | movaps xmm9,XMMWORD[((-168))+rax]
|
---|
289 | movaps xmm10,XMMWORD[((-152))+rax]
|
---|
290 | movaps xmm11,XMMWORD[((-136))+rax]
|
---|
291 | movaps xmm12,XMMWORD[((-120))+rax]
|
---|
292 |
|
---|
293 |
|
---|
294 |
|
---|
295 | mov r15,QWORD[((-48))+rax]
|
---|
296 |
|
---|
297 | mov r14,QWORD[((-40))+rax]
|
---|
298 |
|
---|
299 | mov r13,QWORD[((-32))+rax]
|
---|
300 |
|
---|
301 | mov r12,QWORD[((-24))+rax]
|
---|
302 |
|
---|
303 | mov rbp,QWORD[((-16))+rax]
|
---|
304 |
|
---|
305 | mov rbx,QWORD[((-8))+rax]
|
---|
306 |
|
---|
307 | lea rsp,[rax]
|
---|
308 |
|
---|
309 | $L$enc4x_epilogue:
|
---|
310 | mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
---|
311 | mov rsi,QWORD[16+rsp]
|
---|
312 | DB 0F3h,0C3h ;repret
|
---|
313 |
|
---|
314 | $L$SEH_end_aesni_multi_cbc_encrypt:
|
---|
315 |
|
---|
316 | global aesni_multi_cbc_decrypt
|
---|
317 |
|
---|
318 | ALIGN 32
|
---|
319 | aesni_multi_cbc_decrypt:
|
---|
320 | mov QWORD[8+rsp],rdi ;WIN64 prologue
|
---|
321 | mov QWORD[16+rsp],rsi
|
---|
322 | mov rax,rsp
|
---|
323 | $L$SEH_begin_aesni_multi_cbc_decrypt:
|
---|
324 | mov rdi,rcx
|
---|
325 | mov rsi,rdx
|
---|
326 | mov rdx,r8
|
---|
327 |
|
---|
328 |
|
---|
329 |
|
---|
330 | mov rax,rsp
|
---|
331 |
|
---|
332 | push rbx
|
---|
333 |
|
---|
334 | push rbp
|
---|
335 |
|
---|
336 | push r12
|
---|
337 |
|
---|
338 | push r13
|
---|
339 |
|
---|
340 | push r14
|
---|
341 |
|
---|
342 | push r15
|
---|
343 |
|
---|
344 | lea rsp,[((-168))+rsp]
|
---|
345 | movaps XMMWORD[rsp],xmm6
|
---|
346 | movaps XMMWORD[16+rsp],xmm7
|
---|
347 | movaps XMMWORD[32+rsp],xmm8
|
---|
348 | movaps XMMWORD[48+rsp],xmm9
|
---|
349 | movaps XMMWORD[64+rsp],xmm10
|
---|
350 | movaps XMMWORD[80+rsp],xmm11
|
---|
351 | movaps XMMWORD[96+rsp],xmm12
|
---|
352 | movaps XMMWORD[(-104)+rax],xmm13
|
---|
353 | movaps XMMWORD[(-88)+rax],xmm14
|
---|
354 | movaps XMMWORD[(-72)+rax],xmm15
|
---|
355 |
|
---|
356 |
|
---|
357 |
|
---|
358 |
|
---|
359 |
|
---|
360 |
|
---|
361 | sub rsp,48
|
---|
362 | and rsp,-64
|
---|
363 | mov QWORD[16+rsp],rax
|
---|
364 |
|
---|
365 |
|
---|
366 | $L$dec4x_body:
|
---|
367 | movdqu xmm12,XMMWORD[rsi]
|
---|
368 | lea rsi,[120+rsi]
|
---|
369 | lea rdi,[80+rdi]
|
---|
370 |
|
---|
371 | $L$dec4x_loop_grande:
|
---|
372 | mov DWORD[24+rsp],edx
|
---|
373 | xor edx,edx
|
---|
374 | mov ecx,DWORD[((-64))+rdi]
|
---|
375 | mov r8,QWORD[((-80))+rdi]
|
---|
376 | cmp ecx,edx
|
---|
377 | mov r12,QWORD[((-72))+rdi]
|
---|
378 | cmovg edx,ecx
|
---|
379 | test ecx,ecx
|
---|
380 | movdqu xmm6,XMMWORD[((-56))+rdi]
|
---|
381 | mov DWORD[32+rsp],ecx
|
---|
382 | cmovle r8,rsp
|
---|
383 | mov ecx,DWORD[((-24))+rdi]
|
---|
384 | mov r9,QWORD[((-40))+rdi]
|
---|
385 | cmp ecx,edx
|
---|
386 | mov r13,QWORD[((-32))+rdi]
|
---|
387 | cmovg edx,ecx
|
---|
388 | test ecx,ecx
|
---|
389 | movdqu xmm7,XMMWORD[((-16))+rdi]
|
---|
390 | mov DWORD[36+rsp],ecx
|
---|
391 | cmovle r9,rsp
|
---|
392 | mov ecx,DWORD[16+rdi]
|
---|
393 | mov r10,QWORD[rdi]
|
---|
394 | cmp ecx,edx
|
---|
395 | mov r14,QWORD[8+rdi]
|
---|
396 | cmovg edx,ecx
|
---|
397 | test ecx,ecx
|
---|
398 | movdqu xmm8,XMMWORD[24+rdi]
|
---|
399 | mov DWORD[40+rsp],ecx
|
---|
400 | cmovle r10,rsp
|
---|
401 | mov ecx,DWORD[56+rdi]
|
---|
402 | mov r11,QWORD[40+rdi]
|
---|
403 | cmp ecx,edx
|
---|
404 | mov r15,QWORD[48+rdi]
|
---|
405 | cmovg edx,ecx
|
---|
406 | test ecx,ecx
|
---|
407 | movdqu xmm9,XMMWORD[64+rdi]
|
---|
408 | mov DWORD[44+rsp],ecx
|
---|
409 | cmovle r11,rsp
|
---|
410 | test edx,edx
|
---|
411 | jz NEAR $L$dec4x_done
|
---|
412 |
|
---|
413 | movups xmm1,XMMWORD[((16-120))+rsi]
|
---|
414 | movups xmm0,XMMWORD[((32-120))+rsi]
|
---|
415 | mov eax,DWORD[((240-120))+rsi]
|
---|
416 | movdqu xmm2,XMMWORD[r8]
|
---|
417 | movdqu xmm3,XMMWORD[r9]
|
---|
418 | pxor xmm2,xmm12
|
---|
419 | movdqu xmm4,XMMWORD[r10]
|
---|
420 | pxor xmm3,xmm12
|
---|
421 | movdqu xmm5,XMMWORD[r11]
|
---|
422 | pxor xmm4,xmm12
|
---|
423 | pxor xmm5,xmm12
|
---|
424 | movdqa xmm10,XMMWORD[32+rsp]
|
---|
425 | xor rbx,rbx
|
---|
426 | jmp NEAR $L$oop_dec4x
|
---|
427 |
|
---|
428 | ALIGN 32
|
---|
429 | $L$oop_dec4x:
|
---|
430 | add rbx,16
|
---|
431 | lea rbp,[16+rsp]
|
---|
432 | mov ecx,1
|
---|
433 | sub rbp,rbx
|
---|
434 |
|
---|
435 | DB 102,15,56,222,209
|
---|
436 | prefetcht0 [31+rbx*1+r8]
|
---|
437 | prefetcht0 [31+rbx*1+r9]
|
---|
438 | DB 102,15,56,222,217
|
---|
439 | prefetcht0 [31+rbx*1+r10]
|
---|
440 | prefetcht0 [31+rbx*1+r11]
|
---|
441 | DB 102,15,56,222,225
|
---|
442 | DB 102,15,56,222,233
|
---|
443 | movups xmm1,XMMWORD[((48-120))+rsi]
|
---|
444 | cmp ecx,DWORD[32+rsp]
|
---|
445 | DB 102,15,56,222,208
|
---|
446 | DB 102,15,56,222,216
|
---|
447 | DB 102,15,56,222,224
|
---|
448 | cmovge r8,rbp
|
---|
449 | cmovg r12,rbp
|
---|
450 | DB 102,15,56,222,232
|
---|
451 | movups xmm0,XMMWORD[((-56))+rsi]
|
---|
452 | cmp ecx,DWORD[36+rsp]
|
---|
453 | DB 102,15,56,222,209
|
---|
454 | DB 102,15,56,222,217
|
---|
455 | DB 102,15,56,222,225
|
---|
456 | cmovge r9,rbp
|
---|
457 | cmovg r13,rbp
|
---|
458 | DB 102,15,56,222,233
|
---|
459 | movups xmm1,XMMWORD[((-40))+rsi]
|
---|
460 | cmp ecx,DWORD[40+rsp]
|
---|
461 | DB 102,15,56,222,208
|
---|
462 | DB 102,15,56,222,216
|
---|
463 | DB 102,15,56,222,224
|
---|
464 | cmovge r10,rbp
|
---|
465 | cmovg r14,rbp
|
---|
466 | DB 102,15,56,222,232
|
---|
467 | movups xmm0,XMMWORD[((-24))+rsi]
|
---|
468 | cmp ecx,DWORD[44+rsp]
|
---|
469 | DB 102,15,56,222,209
|
---|
470 | DB 102,15,56,222,217
|
---|
471 | DB 102,15,56,222,225
|
---|
472 | cmovge r11,rbp
|
---|
473 | cmovg r15,rbp
|
---|
474 | DB 102,15,56,222,233
|
---|
475 | movups xmm1,XMMWORD[((-8))+rsi]
|
---|
476 | movdqa xmm11,xmm10
|
---|
477 | DB 102,15,56,222,208
|
---|
478 | prefetcht0 [15+rbx*1+r12]
|
---|
479 | prefetcht0 [15+rbx*1+r13]
|
---|
480 | DB 102,15,56,222,216
|
---|
481 | prefetcht0 [15+rbx*1+r14]
|
---|
482 | prefetcht0 [15+rbx*1+r15]
|
---|
483 | DB 102,15,56,222,224
|
---|
484 | DB 102,15,56,222,232
|
---|
485 | movups xmm0,XMMWORD[((128-120))+rsi]
|
---|
486 | pxor xmm12,xmm12
|
---|
487 |
|
---|
488 | DB 102,15,56,222,209
|
---|
489 | pcmpgtd xmm11,xmm12
|
---|
490 | movdqu xmm12,XMMWORD[((-120))+rsi]
|
---|
491 | DB 102,15,56,222,217
|
---|
492 | paddd xmm10,xmm11
|
---|
493 | movdqa XMMWORD[32+rsp],xmm10
|
---|
494 | DB 102,15,56,222,225
|
---|
495 | DB 102,15,56,222,233
|
---|
496 | movups xmm1,XMMWORD[((144-120))+rsi]
|
---|
497 |
|
---|
498 | cmp eax,11
|
---|
499 |
|
---|
500 | DB 102,15,56,222,208
|
---|
501 | DB 102,15,56,222,216
|
---|
502 | DB 102,15,56,222,224
|
---|
503 | DB 102,15,56,222,232
|
---|
504 | movups xmm0,XMMWORD[((160-120))+rsi]
|
---|
505 |
|
---|
506 | jb NEAR $L$dec4x_tail
|
---|
507 |
|
---|
508 | DB 102,15,56,222,209
|
---|
509 | DB 102,15,56,222,217
|
---|
510 | DB 102,15,56,222,225
|
---|
511 | DB 102,15,56,222,233
|
---|
512 | movups xmm1,XMMWORD[((176-120))+rsi]
|
---|
513 |
|
---|
514 | DB 102,15,56,222,208
|
---|
515 | DB 102,15,56,222,216
|
---|
516 | DB 102,15,56,222,224
|
---|
517 | DB 102,15,56,222,232
|
---|
518 | movups xmm0,XMMWORD[((192-120))+rsi]
|
---|
519 |
|
---|
520 | je NEAR $L$dec4x_tail
|
---|
521 |
|
---|
522 | DB 102,15,56,222,209
|
---|
523 | DB 102,15,56,222,217
|
---|
524 | DB 102,15,56,222,225
|
---|
525 | DB 102,15,56,222,233
|
---|
526 | movups xmm1,XMMWORD[((208-120))+rsi]
|
---|
527 |
|
---|
528 | DB 102,15,56,222,208
|
---|
529 | DB 102,15,56,222,216
|
---|
530 | DB 102,15,56,222,224
|
---|
531 | DB 102,15,56,222,232
|
---|
532 | movups xmm0,XMMWORD[((224-120))+rsi]
|
---|
533 | jmp NEAR $L$dec4x_tail
|
---|
534 |
|
---|
535 | ALIGN 32
|
---|
536 | $L$dec4x_tail:
|
---|
537 | DB 102,15,56,222,209
|
---|
538 | DB 102,15,56,222,217
|
---|
539 | DB 102,15,56,222,225
|
---|
540 | pxor xmm6,xmm0
|
---|
541 | pxor xmm7,xmm0
|
---|
542 | DB 102,15,56,222,233
|
---|
543 | movdqu xmm1,XMMWORD[((16-120))+rsi]
|
---|
544 | pxor xmm8,xmm0
|
---|
545 | pxor xmm9,xmm0
|
---|
546 | movdqu xmm0,XMMWORD[((32-120))+rsi]
|
---|
547 |
|
---|
548 | DB 102,15,56,223,214
|
---|
549 | DB 102,15,56,223,223
|
---|
550 | movdqu xmm6,XMMWORD[((-16))+rbx*1+r8]
|
---|
551 | movdqu xmm7,XMMWORD[((-16))+rbx*1+r9]
|
---|
552 | DB 102,65,15,56,223,224
|
---|
553 | DB 102,65,15,56,223,233
|
---|
554 | movdqu xmm8,XMMWORD[((-16))+rbx*1+r10]
|
---|
555 | movdqu xmm9,XMMWORD[((-16))+rbx*1+r11]
|
---|
556 |
|
---|
557 | movups XMMWORD[(-16)+rbx*1+r12],xmm2
|
---|
558 | movdqu xmm2,XMMWORD[rbx*1+r8]
|
---|
559 | movups XMMWORD[(-16)+rbx*1+r13],xmm3
|
---|
560 | movdqu xmm3,XMMWORD[rbx*1+r9]
|
---|
561 | pxor xmm2,xmm12
|
---|
562 | movups XMMWORD[(-16)+rbx*1+r14],xmm4
|
---|
563 | movdqu xmm4,XMMWORD[rbx*1+r10]
|
---|
564 | pxor xmm3,xmm12
|
---|
565 | movups XMMWORD[(-16)+rbx*1+r15],xmm5
|
---|
566 | movdqu xmm5,XMMWORD[rbx*1+r11]
|
---|
567 | pxor xmm4,xmm12
|
---|
568 | pxor xmm5,xmm12
|
---|
569 |
|
---|
570 | dec edx
|
---|
571 | jnz NEAR $L$oop_dec4x
|
---|
572 |
|
---|
573 | mov rax,QWORD[16+rsp]
|
---|
574 |
|
---|
575 | mov edx,DWORD[24+rsp]
|
---|
576 |
|
---|
577 | lea rdi,[160+rdi]
|
---|
578 | dec edx
|
---|
579 | jnz NEAR $L$dec4x_loop_grande
|
---|
580 |
|
---|
581 | $L$dec4x_done:
|
---|
582 | movaps xmm6,XMMWORD[((-216))+rax]
|
---|
583 | movaps xmm7,XMMWORD[((-200))+rax]
|
---|
584 | movaps xmm8,XMMWORD[((-184))+rax]
|
---|
585 | movaps xmm9,XMMWORD[((-168))+rax]
|
---|
586 | movaps xmm10,XMMWORD[((-152))+rax]
|
---|
587 | movaps xmm11,XMMWORD[((-136))+rax]
|
---|
588 | movaps xmm12,XMMWORD[((-120))+rax]
|
---|
589 |
|
---|
590 |
|
---|
591 |
|
---|
592 | mov r15,QWORD[((-48))+rax]
|
---|
593 |
|
---|
594 | mov r14,QWORD[((-40))+rax]
|
---|
595 |
|
---|
596 | mov r13,QWORD[((-32))+rax]
|
---|
597 |
|
---|
598 | mov r12,QWORD[((-24))+rax]
|
---|
599 |
|
---|
600 | mov rbp,QWORD[((-16))+rax]
|
---|
601 |
|
---|
602 | mov rbx,QWORD[((-8))+rax]
|
---|
603 |
|
---|
604 | lea rsp,[rax]
|
---|
605 |
|
---|
606 | $L$dec4x_epilogue:
|
---|
607 | mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
---|
608 | mov rsi,QWORD[16+rsp]
|
---|
609 | DB 0F3h,0C3h ;repret
|
---|
610 |
|
---|
611 | $L$SEH_end_aesni_multi_cbc_decrypt:
|
---|
612 | EXTERN __imp_RtlVirtualUnwind
|
---|
613 |
|
---|
614 | ALIGN 16
|
---|
615 | se_handler:
|
---|
616 | push rsi
|
---|
617 | push rdi
|
---|
618 | push rbx
|
---|
619 | push rbp
|
---|
620 | push r12
|
---|
621 | push r13
|
---|
622 | push r14
|
---|
623 | push r15
|
---|
624 | pushfq
|
---|
625 | sub rsp,64
|
---|
626 |
|
---|
627 | mov rax,QWORD[120+r8]
|
---|
628 | mov rbx,QWORD[248+r8]
|
---|
629 |
|
---|
630 | mov rsi,QWORD[8+r9]
|
---|
631 | mov r11,QWORD[56+r9]
|
---|
632 |
|
---|
633 | mov r10d,DWORD[r11]
|
---|
634 | lea r10,[r10*1+rsi]
|
---|
635 | cmp rbx,r10
|
---|
636 | jb NEAR $L$in_prologue
|
---|
637 |
|
---|
638 | mov rax,QWORD[152+r8]
|
---|
639 |
|
---|
640 | mov r10d,DWORD[4+r11]
|
---|
641 | lea r10,[r10*1+rsi]
|
---|
642 | cmp rbx,r10
|
---|
643 | jae NEAR $L$in_prologue
|
---|
644 |
|
---|
645 | mov rax,QWORD[16+rax]
|
---|
646 |
|
---|
647 | mov rbx,QWORD[((-8))+rax]
|
---|
648 | mov rbp,QWORD[((-16))+rax]
|
---|
649 | mov r12,QWORD[((-24))+rax]
|
---|
650 | mov r13,QWORD[((-32))+rax]
|
---|
651 | mov r14,QWORD[((-40))+rax]
|
---|
652 | mov r15,QWORD[((-48))+rax]
|
---|
653 | mov QWORD[144+r8],rbx
|
---|
654 | mov QWORD[160+r8],rbp
|
---|
655 | mov QWORD[216+r8],r12
|
---|
656 | mov QWORD[224+r8],r13
|
---|
657 | mov QWORD[232+r8],r14
|
---|
658 | mov QWORD[240+r8],r15
|
---|
659 |
|
---|
660 | lea rsi,[((-56-160))+rax]
|
---|
661 | lea rdi,[512+r8]
|
---|
662 | mov ecx,20
|
---|
663 | DD 0xa548f3fc
|
---|
664 |
|
---|
665 | $L$in_prologue:
|
---|
666 | mov rdi,QWORD[8+rax]
|
---|
667 | mov rsi,QWORD[16+rax]
|
---|
668 | mov QWORD[152+r8],rax
|
---|
669 | mov QWORD[168+r8],rsi
|
---|
670 | mov QWORD[176+r8],rdi
|
---|
671 |
|
---|
672 | mov rdi,QWORD[40+r9]
|
---|
673 | mov rsi,r8
|
---|
674 | mov ecx,154
|
---|
675 | DD 0xa548f3fc
|
---|
676 |
|
---|
677 | mov rsi,r9
|
---|
678 | xor rcx,rcx
|
---|
679 | mov rdx,QWORD[8+rsi]
|
---|
680 | mov r8,QWORD[rsi]
|
---|
681 | mov r9,QWORD[16+rsi]
|
---|
682 | mov r10,QWORD[40+rsi]
|
---|
683 | lea r11,[56+rsi]
|
---|
684 | lea r12,[24+rsi]
|
---|
685 | mov QWORD[32+rsp],r10
|
---|
686 | mov QWORD[40+rsp],r11
|
---|
687 | mov QWORD[48+rsp],r12
|
---|
688 | mov QWORD[56+rsp],rcx
|
---|
689 | call QWORD[__imp_RtlVirtualUnwind]
|
---|
690 |
|
---|
691 | mov eax,1
|
---|
692 | add rsp,64
|
---|
693 | popfq
|
---|
694 | pop r15
|
---|
695 | pop r14
|
---|
696 | pop r13
|
---|
697 | pop r12
|
---|
698 | pop rbp
|
---|
699 | pop rbx
|
---|
700 | pop rdi
|
---|
701 | pop rsi
|
---|
702 | DB 0F3h,0C3h ;repret
|
---|
703 |
|
---|
704 |
|
---|
705 | section .pdata rdata align=4
|
---|
706 | ALIGN 4
|
---|
707 | DD $L$SEH_begin_aesni_multi_cbc_encrypt wrt ..imagebase
|
---|
708 | DD $L$SEH_end_aesni_multi_cbc_encrypt wrt ..imagebase
|
---|
709 | DD $L$SEH_info_aesni_multi_cbc_encrypt wrt ..imagebase
|
---|
710 | DD $L$SEH_begin_aesni_multi_cbc_decrypt wrt ..imagebase
|
---|
711 | DD $L$SEH_end_aesni_multi_cbc_decrypt wrt ..imagebase
|
---|
712 | DD $L$SEH_info_aesni_multi_cbc_decrypt wrt ..imagebase
|
---|
713 | section .xdata rdata align=8
|
---|
714 | ALIGN 8
|
---|
715 | $L$SEH_info_aesni_multi_cbc_encrypt:
|
---|
716 | DB 9,0,0,0
|
---|
717 | DD se_handler wrt ..imagebase
|
---|
718 | DD $L$enc4x_body wrt ..imagebase,$L$enc4x_epilogue wrt ..imagebase
|
---|
719 | $L$SEH_info_aesni_multi_cbc_decrypt:
|
---|
720 | DB 9,0,0,0
|
---|
721 | DD se_handler wrt ..imagebase
|
---|
722 | DD $L$dec4x_body wrt ..imagebase,$L$dec4x_epilogue wrt ..imagebase
|
---|