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