1 | default rel
|
---|
2 | %define XMMWORD
|
---|
3 | %define YMMWORD
|
---|
4 | %define ZMMWORD
|
---|
5 | section .text code align=64
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 |
|
---|
20 |
|
---|
21 |
|
---|
22 |
|
---|
23 |
|
---|
24 | ALIGN 16
|
---|
25 | _vpaes_encrypt_core:
|
---|
26 |
|
---|
27 | mov r9,rdx
|
---|
28 | mov r11,16
|
---|
29 | mov eax,DWORD[240+rdx]
|
---|
30 | movdqa xmm1,xmm9
|
---|
31 | movdqa xmm2,XMMWORD[$L$k_ipt]
|
---|
32 | pandn xmm1,xmm0
|
---|
33 | movdqu xmm5,XMMWORD[r9]
|
---|
34 | psrld xmm1,4
|
---|
35 | pand xmm0,xmm9
|
---|
36 | DB 102,15,56,0,208
|
---|
37 | movdqa xmm0,XMMWORD[(($L$k_ipt+16))]
|
---|
38 | DB 102,15,56,0,193
|
---|
39 | pxor xmm2,xmm5
|
---|
40 | add r9,16
|
---|
41 | pxor xmm0,xmm2
|
---|
42 | lea r10,[$L$k_mc_backward]
|
---|
43 | jmp NEAR $L$enc_entry
|
---|
44 |
|
---|
45 | ALIGN 16
|
---|
46 | $L$enc_loop:
|
---|
47 |
|
---|
48 | movdqa xmm4,xmm13
|
---|
49 | movdqa xmm0,xmm12
|
---|
50 | DB 102,15,56,0,226
|
---|
51 | DB 102,15,56,0,195
|
---|
52 | pxor xmm4,xmm5
|
---|
53 | movdqa xmm5,xmm15
|
---|
54 | pxor xmm0,xmm4
|
---|
55 | movdqa xmm1,XMMWORD[((-64))+r10*1+r11]
|
---|
56 | DB 102,15,56,0,234
|
---|
57 | movdqa xmm4,XMMWORD[r10*1+r11]
|
---|
58 | movdqa xmm2,xmm14
|
---|
59 | DB 102,15,56,0,211
|
---|
60 | movdqa xmm3,xmm0
|
---|
61 | pxor xmm2,xmm5
|
---|
62 | DB 102,15,56,0,193
|
---|
63 | add r9,16
|
---|
64 | pxor xmm0,xmm2
|
---|
65 | DB 102,15,56,0,220
|
---|
66 | add r11,16
|
---|
67 | pxor xmm3,xmm0
|
---|
68 | DB 102,15,56,0,193
|
---|
69 | and r11,0x30
|
---|
70 | sub rax,1
|
---|
71 | pxor xmm0,xmm3
|
---|
72 |
|
---|
73 | $L$enc_entry:
|
---|
74 |
|
---|
75 | movdqa xmm1,xmm9
|
---|
76 | movdqa xmm5,xmm11
|
---|
77 | pandn xmm1,xmm0
|
---|
78 | psrld xmm1,4
|
---|
79 | pand xmm0,xmm9
|
---|
80 | DB 102,15,56,0,232
|
---|
81 | movdqa xmm3,xmm10
|
---|
82 | pxor xmm0,xmm1
|
---|
83 | DB 102,15,56,0,217
|
---|
84 | movdqa xmm4,xmm10
|
---|
85 | pxor xmm3,xmm5
|
---|
86 | DB 102,15,56,0,224
|
---|
87 | movdqa xmm2,xmm10
|
---|
88 | pxor xmm4,xmm5
|
---|
89 | DB 102,15,56,0,211
|
---|
90 | movdqa xmm3,xmm10
|
---|
91 | pxor xmm2,xmm0
|
---|
92 | DB 102,15,56,0,220
|
---|
93 | movdqu xmm5,XMMWORD[r9]
|
---|
94 | pxor xmm3,xmm1
|
---|
95 | jnz NEAR $L$enc_loop
|
---|
96 |
|
---|
97 |
|
---|
98 | movdqa xmm4,XMMWORD[((-96))+r10]
|
---|
99 | movdqa xmm0,XMMWORD[((-80))+r10]
|
---|
100 | DB 102,15,56,0,226
|
---|
101 | pxor xmm4,xmm5
|
---|
102 | DB 102,15,56,0,195
|
---|
103 | movdqa xmm1,XMMWORD[64+r10*1+r11]
|
---|
104 | pxor xmm0,xmm4
|
---|
105 | DB 102,15,56,0,193
|
---|
106 | DB 0F3h,0C3h ;repret
|
---|
107 |
|
---|
108 |
|
---|
109 |
|
---|
110 |
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 | ALIGN 16
|
---|
117 | _vpaes_decrypt_core:
|
---|
118 |
|
---|
119 | mov r9,rdx
|
---|
120 | mov eax,DWORD[240+rdx]
|
---|
121 | movdqa xmm1,xmm9
|
---|
122 | movdqa xmm2,XMMWORD[$L$k_dipt]
|
---|
123 | pandn xmm1,xmm0
|
---|
124 | mov r11,rax
|
---|
125 | psrld xmm1,4
|
---|
126 | movdqu xmm5,XMMWORD[r9]
|
---|
127 | shl r11,4
|
---|
128 | pand xmm0,xmm9
|
---|
129 | DB 102,15,56,0,208
|
---|
130 | movdqa xmm0,XMMWORD[(($L$k_dipt+16))]
|
---|
131 | xor r11,0x30
|
---|
132 | lea r10,[$L$k_dsbd]
|
---|
133 | DB 102,15,56,0,193
|
---|
134 | and r11,0x30
|
---|
135 | pxor xmm2,xmm5
|
---|
136 | movdqa xmm5,XMMWORD[(($L$k_mc_forward+48))]
|
---|
137 | pxor xmm0,xmm2
|
---|
138 | add r9,16
|
---|
139 | add r11,r10
|
---|
140 | jmp NEAR $L$dec_entry
|
---|
141 |
|
---|
142 | ALIGN 16
|
---|
143 | $L$dec_loop:
|
---|
144 |
|
---|
145 |
|
---|
146 |
|
---|
147 | movdqa xmm4,XMMWORD[((-32))+r10]
|
---|
148 | movdqa xmm1,XMMWORD[((-16))+r10]
|
---|
149 | DB 102,15,56,0,226
|
---|
150 | DB 102,15,56,0,203
|
---|
151 | pxor xmm0,xmm4
|
---|
152 | movdqa xmm4,XMMWORD[r10]
|
---|
153 | pxor xmm0,xmm1
|
---|
154 | movdqa xmm1,XMMWORD[16+r10]
|
---|
155 |
|
---|
156 | DB 102,15,56,0,226
|
---|
157 | DB 102,15,56,0,197
|
---|
158 | DB 102,15,56,0,203
|
---|
159 | pxor xmm0,xmm4
|
---|
160 | movdqa xmm4,XMMWORD[32+r10]
|
---|
161 | pxor xmm0,xmm1
|
---|
162 | movdqa xmm1,XMMWORD[48+r10]
|
---|
163 |
|
---|
164 | DB 102,15,56,0,226
|
---|
165 | DB 102,15,56,0,197
|
---|
166 | DB 102,15,56,0,203
|
---|
167 | pxor xmm0,xmm4
|
---|
168 | movdqa xmm4,XMMWORD[64+r10]
|
---|
169 | pxor xmm0,xmm1
|
---|
170 | movdqa xmm1,XMMWORD[80+r10]
|
---|
171 |
|
---|
172 | DB 102,15,56,0,226
|
---|
173 | DB 102,15,56,0,197
|
---|
174 | DB 102,15,56,0,203
|
---|
175 | pxor xmm0,xmm4
|
---|
176 | add r9,16
|
---|
177 | DB 102,15,58,15,237,12
|
---|
178 | pxor xmm0,xmm1
|
---|
179 | sub rax,1
|
---|
180 |
|
---|
181 | $L$dec_entry:
|
---|
182 |
|
---|
183 | movdqa xmm1,xmm9
|
---|
184 | pandn xmm1,xmm0
|
---|
185 | movdqa xmm2,xmm11
|
---|
186 | psrld xmm1,4
|
---|
187 | pand xmm0,xmm9
|
---|
188 | DB 102,15,56,0,208
|
---|
189 | movdqa xmm3,xmm10
|
---|
190 | pxor xmm0,xmm1
|
---|
191 | DB 102,15,56,0,217
|
---|
192 | movdqa xmm4,xmm10
|
---|
193 | pxor xmm3,xmm2
|
---|
194 | DB 102,15,56,0,224
|
---|
195 | pxor xmm4,xmm2
|
---|
196 | movdqa xmm2,xmm10
|
---|
197 | DB 102,15,56,0,211
|
---|
198 | movdqa xmm3,xmm10
|
---|
199 | pxor xmm2,xmm0
|
---|
200 | DB 102,15,56,0,220
|
---|
201 | movdqu xmm0,XMMWORD[r9]
|
---|
202 | pxor xmm3,xmm1
|
---|
203 | jnz NEAR $L$dec_loop
|
---|
204 |
|
---|
205 |
|
---|
206 | movdqa xmm4,XMMWORD[96+r10]
|
---|
207 | DB 102,15,56,0,226
|
---|
208 | pxor xmm4,xmm0
|
---|
209 | movdqa xmm0,XMMWORD[112+r10]
|
---|
210 | movdqa xmm2,XMMWORD[((-352))+r11]
|
---|
211 | DB 102,15,56,0,195
|
---|
212 | pxor xmm0,xmm4
|
---|
213 | DB 102,15,56,0,194
|
---|
214 | DB 0F3h,0C3h ;repret
|
---|
215 |
|
---|
216 |
|
---|
217 |
|
---|
218 |
|
---|
219 |
|
---|
220 |
|
---|
221 |
|
---|
222 |
|
---|
223 |
|
---|
224 | ALIGN 16
|
---|
225 | _vpaes_schedule_core:
|
---|
226 |
|
---|
227 |
|
---|
228 |
|
---|
229 |
|
---|
230 |
|
---|
231 |
|
---|
232 | call _vpaes_preheat
|
---|
233 | movdqa xmm8,XMMWORD[$L$k_rcon]
|
---|
234 | movdqu xmm0,XMMWORD[rdi]
|
---|
235 |
|
---|
236 |
|
---|
237 | movdqa xmm3,xmm0
|
---|
238 | lea r11,[$L$k_ipt]
|
---|
239 | call _vpaes_schedule_transform
|
---|
240 | movdqa xmm7,xmm0
|
---|
241 |
|
---|
242 | lea r10,[$L$k_sr]
|
---|
243 | test rcx,rcx
|
---|
244 | jnz NEAR $L$schedule_am_decrypting
|
---|
245 |
|
---|
246 |
|
---|
247 | movdqu XMMWORD[rdx],xmm0
|
---|
248 | jmp NEAR $L$schedule_go
|
---|
249 |
|
---|
250 | $L$schedule_am_decrypting:
|
---|
251 |
|
---|
252 | movdqa xmm1,XMMWORD[r10*1+r8]
|
---|
253 | DB 102,15,56,0,217
|
---|
254 | movdqu XMMWORD[rdx],xmm3
|
---|
255 | xor r8,0x30
|
---|
256 |
|
---|
257 | $L$schedule_go:
|
---|
258 | cmp esi,192
|
---|
259 | ja NEAR $L$schedule_256
|
---|
260 | je NEAR $L$schedule_192
|
---|
261 |
|
---|
262 |
|
---|
263 |
|
---|
264 |
|
---|
265 |
|
---|
266 |
|
---|
267 |
|
---|
268 |
|
---|
269 |
|
---|
270 |
|
---|
271 | $L$schedule_128:
|
---|
272 | mov esi,10
|
---|
273 |
|
---|
274 | $L$oop_schedule_128:
|
---|
275 | call _vpaes_schedule_round
|
---|
276 | dec rsi
|
---|
277 | jz NEAR $L$schedule_mangle_last
|
---|
278 | call _vpaes_schedule_mangle
|
---|
279 | jmp NEAR $L$oop_schedule_128
|
---|
280 |
|
---|
281 |
|
---|
282 |
|
---|
283 |
|
---|
284 |
|
---|
285 |
|
---|
286 |
|
---|
287 |
|
---|
288 |
|
---|
289 |
|
---|
290 |
|
---|
291 |
|
---|
292 |
|
---|
293 |
|
---|
294 |
|
---|
295 |
|
---|
296 | ALIGN 16
|
---|
297 | $L$schedule_192:
|
---|
298 | movdqu xmm0,XMMWORD[8+rdi]
|
---|
299 | call _vpaes_schedule_transform
|
---|
300 | movdqa xmm6,xmm0
|
---|
301 | pxor xmm4,xmm4
|
---|
302 | movhlps xmm6,xmm4
|
---|
303 | mov esi,4
|
---|
304 |
|
---|
305 | $L$oop_schedule_192:
|
---|
306 | call _vpaes_schedule_round
|
---|
307 | DB 102,15,58,15,198,8
|
---|
308 | call _vpaes_schedule_mangle
|
---|
309 | call _vpaes_schedule_192_smear
|
---|
310 | call _vpaes_schedule_mangle
|
---|
311 | call _vpaes_schedule_round
|
---|
312 | dec rsi
|
---|
313 | jz NEAR $L$schedule_mangle_last
|
---|
314 | call _vpaes_schedule_mangle
|
---|
315 | call _vpaes_schedule_192_smear
|
---|
316 | jmp NEAR $L$oop_schedule_192
|
---|
317 |
|
---|
318 |
|
---|
319 |
|
---|
320 |
|
---|
321 |
|
---|
322 |
|
---|
323 |
|
---|
324 |
|
---|
325 |
|
---|
326 |
|
---|
327 |
|
---|
328 | ALIGN 16
|
---|
329 | $L$schedule_256:
|
---|
330 | movdqu xmm0,XMMWORD[16+rdi]
|
---|
331 | call _vpaes_schedule_transform
|
---|
332 | mov esi,7
|
---|
333 |
|
---|
334 | $L$oop_schedule_256:
|
---|
335 | call _vpaes_schedule_mangle
|
---|
336 | movdqa xmm6,xmm0
|
---|
337 |
|
---|
338 |
|
---|
339 | call _vpaes_schedule_round
|
---|
340 | dec rsi
|
---|
341 | jz NEAR $L$schedule_mangle_last
|
---|
342 | call _vpaes_schedule_mangle
|
---|
343 |
|
---|
344 |
|
---|
345 | pshufd xmm0,xmm0,0xFF
|
---|
346 | movdqa xmm5,xmm7
|
---|
347 | movdqa xmm7,xmm6
|
---|
348 | call _vpaes_schedule_low_round
|
---|
349 | movdqa xmm7,xmm5
|
---|
350 |
|
---|
351 | jmp NEAR $L$oop_schedule_256
|
---|
352 |
|
---|
353 |
|
---|
354 |
|
---|
355 |
|
---|
356 |
|
---|
357 |
|
---|
358 |
|
---|
359 |
|
---|
360 |
|
---|
361 |
|
---|
362 |
|
---|
363 |
|
---|
364 | ALIGN 16
|
---|
365 | $L$schedule_mangle_last:
|
---|
366 |
|
---|
367 | lea r11,[$L$k_deskew]
|
---|
368 | test rcx,rcx
|
---|
369 | jnz NEAR $L$schedule_mangle_last_dec
|
---|
370 |
|
---|
371 |
|
---|
372 | movdqa xmm1,XMMWORD[r10*1+r8]
|
---|
373 | DB 102,15,56,0,193
|
---|
374 | lea r11,[$L$k_opt]
|
---|
375 | add rdx,32
|
---|
376 |
|
---|
377 | $L$schedule_mangle_last_dec:
|
---|
378 | add rdx,-16
|
---|
379 | pxor xmm0,XMMWORD[$L$k_s63]
|
---|
380 | call _vpaes_schedule_transform
|
---|
381 | movdqu XMMWORD[rdx],xmm0
|
---|
382 |
|
---|
383 |
|
---|
384 | pxor xmm0,xmm0
|
---|
385 | pxor xmm1,xmm1
|
---|
386 | pxor xmm2,xmm2
|
---|
387 | pxor xmm3,xmm3
|
---|
388 | pxor xmm4,xmm4
|
---|
389 | pxor xmm5,xmm5
|
---|
390 | pxor xmm6,xmm6
|
---|
391 | pxor xmm7,xmm7
|
---|
392 | DB 0F3h,0C3h ;repret
|
---|
393 |
|
---|
394 |
|
---|
395 |
|
---|
396 |
|
---|
397 |
|
---|
398 |
|
---|
399 |
|
---|
400 |
|
---|
401 |
|
---|
402 |
|
---|
403 |
|
---|
404 |
|
---|
405 |
|
---|
406 |
|
---|
407 |
|
---|
408 |
|
---|
409 |
|
---|
410 |
|
---|
411 | ALIGN 16
|
---|
412 | _vpaes_schedule_192_smear:
|
---|
413 |
|
---|
414 | pshufd xmm1,xmm6,0x80
|
---|
415 | pshufd xmm0,xmm7,0xFE
|
---|
416 | pxor xmm6,xmm1
|
---|
417 | pxor xmm1,xmm1
|
---|
418 | pxor xmm6,xmm0
|
---|
419 | movdqa xmm0,xmm6
|
---|
420 | movhlps xmm6,xmm1
|
---|
421 | DB 0F3h,0C3h ;repret
|
---|
422 |
|
---|
423 |
|
---|
424 |
|
---|
425 |
|
---|
426 |
|
---|
427 |
|
---|
428 |
|
---|
429 |
|
---|
430 |
|
---|
431 |
|
---|
432 |
|
---|
433 |
|
---|
434 |
|
---|
435 |
|
---|
436 |
|
---|
437 |
|
---|
438 |
|
---|
439 |
|
---|
440 |
|
---|
441 |
|
---|
442 |
|
---|
443 |
|
---|
444 | ALIGN 16
|
---|
445 | _vpaes_schedule_round:
|
---|
446 |
|
---|
447 |
|
---|
448 | pxor xmm1,xmm1
|
---|
449 | DB 102,65,15,58,15,200,15
|
---|
450 | DB 102,69,15,58,15,192,15
|
---|
451 | pxor xmm7,xmm1
|
---|
452 |
|
---|
453 |
|
---|
454 | pshufd xmm0,xmm0,0xFF
|
---|
455 | DB 102,15,58,15,192,1
|
---|
456 |
|
---|
457 |
|
---|
458 |
|
---|
459 |
|
---|
460 | _vpaes_schedule_low_round:
|
---|
461 |
|
---|
462 | movdqa xmm1,xmm7
|
---|
463 | pslldq xmm7,4
|
---|
464 | pxor xmm7,xmm1
|
---|
465 | movdqa xmm1,xmm7
|
---|
466 | pslldq xmm7,8
|
---|
467 | pxor xmm7,xmm1
|
---|
468 | pxor xmm7,XMMWORD[$L$k_s63]
|
---|
469 |
|
---|
470 |
|
---|
471 | movdqa xmm1,xmm9
|
---|
472 | pandn xmm1,xmm0
|
---|
473 | psrld xmm1,4
|
---|
474 | pand xmm0,xmm9
|
---|
475 | movdqa xmm2,xmm11
|
---|
476 | DB 102,15,56,0,208
|
---|
477 | pxor xmm0,xmm1
|
---|
478 | movdqa xmm3,xmm10
|
---|
479 | DB 102,15,56,0,217
|
---|
480 | pxor xmm3,xmm2
|
---|
481 | movdqa xmm4,xmm10
|
---|
482 | DB 102,15,56,0,224
|
---|
483 | pxor xmm4,xmm2
|
---|
484 | movdqa xmm2,xmm10
|
---|
485 | DB 102,15,56,0,211
|
---|
486 | pxor xmm2,xmm0
|
---|
487 | movdqa xmm3,xmm10
|
---|
488 | DB 102,15,56,0,220
|
---|
489 | pxor xmm3,xmm1
|
---|
490 | movdqa xmm4,xmm13
|
---|
491 | DB 102,15,56,0,226
|
---|
492 | movdqa xmm0,xmm12
|
---|
493 | DB 102,15,56,0,195
|
---|
494 | pxor xmm0,xmm4
|
---|
495 |
|
---|
496 |
|
---|
497 | pxor xmm0,xmm7
|
---|
498 | movdqa xmm7,xmm0
|
---|
499 | DB 0F3h,0C3h ;repret
|
---|
500 |
|
---|
501 |
|
---|
502 |
|
---|
503 |
|
---|
504 |
|
---|
505 |
|
---|
506 |
|
---|
507 |
|
---|
508 |
|
---|
509 |
|
---|
510 |
|
---|
511 |
|
---|
512 |
|
---|
513 | ALIGN 16
|
---|
514 | _vpaes_schedule_transform:
|
---|
515 |
|
---|
516 | movdqa xmm1,xmm9
|
---|
517 | pandn xmm1,xmm0
|
---|
518 | psrld xmm1,4
|
---|
519 | pand xmm0,xmm9
|
---|
520 | movdqa xmm2,XMMWORD[r11]
|
---|
521 | DB 102,15,56,0,208
|
---|
522 | movdqa xmm0,XMMWORD[16+r11]
|
---|
523 | DB 102,15,56,0,193
|
---|
524 | pxor xmm0,xmm2
|
---|
525 | DB 0F3h,0C3h ;repret
|
---|
526 |
|
---|
527 |
|
---|
528 |
|
---|
529 |
|
---|
530 |
|
---|
531 |
|
---|
532 |
|
---|
533 |
|
---|
534 |
|
---|
535 |
|
---|
536 |
|
---|
537 |
|
---|
538 |
|
---|
539 |
|
---|
540 |
|
---|
541 |
|
---|
542 |
|
---|
543 |
|
---|
544 |
|
---|
545 |
|
---|
546 |
|
---|
547 |
|
---|
548 |
|
---|
549 |
|
---|
550 |
|
---|
551 |
|
---|
552 |
|
---|
553 | ALIGN 16
|
---|
554 | _vpaes_schedule_mangle:
|
---|
555 |
|
---|
556 | movdqa xmm4,xmm0
|
---|
557 | movdqa xmm5,XMMWORD[$L$k_mc_forward]
|
---|
558 | test rcx,rcx
|
---|
559 | jnz NEAR $L$schedule_mangle_dec
|
---|
560 |
|
---|
561 |
|
---|
562 | add rdx,16
|
---|
563 | pxor xmm4,XMMWORD[$L$k_s63]
|
---|
564 | DB 102,15,56,0,229
|
---|
565 | movdqa xmm3,xmm4
|
---|
566 | DB 102,15,56,0,229
|
---|
567 | pxor xmm3,xmm4
|
---|
568 | DB 102,15,56,0,229
|
---|
569 | pxor xmm3,xmm4
|
---|
570 |
|
---|
571 | jmp NEAR $L$schedule_mangle_both
|
---|
572 | ALIGN 16
|
---|
573 | $L$schedule_mangle_dec:
|
---|
574 |
|
---|
575 | lea r11,[$L$k_dksd]
|
---|
576 | movdqa xmm1,xmm9
|
---|
577 | pandn xmm1,xmm4
|
---|
578 | psrld xmm1,4
|
---|
579 | pand xmm4,xmm9
|
---|
580 |
|
---|
581 | movdqa xmm2,XMMWORD[r11]
|
---|
582 | DB 102,15,56,0,212
|
---|
583 | movdqa xmm3,XMMWORD[16+r11]
|
---|
584 | DB 102,15,56,0,217
|
---|
585 | pxor xmm3,xmm2
|
---|
586 | DB 102,15,56,0,221
|
---|
587 |
|
---|
588 | movdqa xmm2,XMMWORD[32+r11]
|
---|
589 | DB 102,15,56,0,212
|
---|
590 | pxor xmm2,xmm3
|
---|
591 | movdqa xmm3,XMMWORD[48+r11]
|
---|
592 | DB 102,15,56,0,217
|
---|
593 | pxor xmm3,xmm2
|
---|
594 | DB 102,15,56,0,221
|
---|
595 |
|
---|
596 | movdqa xmm2,XMMWORD[64+r11]
|
---|
597 | DB 102,15,56,0,212
|
---|
598 | pxor xmm2,xmm3
|
---|
599 | movdqa xmm3,XMMWORD[80+r11]
|
---|
600 | DB 102,15,56,0,217
|
---|
601 | pxor xmm3,xmm2
|
---|
602 | DB 102,15,56,0,221
|
---|
603 |
|
---|
604 | movdqa xmm2,XMMWORD[96+r11]
|
---|
605 | DB 102,15,56,0,212
|
---|
606 | pxor xmm2,xmm3
|
---|
607 | movdqa xmm3,XMMWORD[112+r11]
|
---|
608 | DB 102,15,56,0,217
|
---|
609 | pxor xmm3,xmm2
|
---|
610 |
|
---|
611 | add rdx,-16
|
---|
612 |
|
---|
613 | $L$schedule_mangle_both:
|
---|
614 | movdqa xmm1,XMMWORD[r10*1+r8]
|
---|
615 | DB 102,15,56,0,217
|
---|
616 | add r8,-16
|
---|
617 | and r8,0x30
|
---|
618 | movdqu XMMWORD[rdx],xmm3
|
---|
619 | DB 0F3h,0C3h ;repret
|
---|
620 |
|
---|
621 |
|
---|
622 |
|
---|
623 |
|
---|
624 |
|
---|
625 |
|
---|
626 | global vpaes_set_encrypt_key
|
---|
627 |
|
---|
628 | ALIGN 16
|
---|
629 | vpaes_set_encrypt_key:
|
---|
630 | mov QWORD[8+rsp],rdi ;WIN64 prologue
|
---|
631 | mov QWORD[16+rsp],rsi
|
---|
632 | mov rax,rsp
|
---|
633 | $L$SEH_begin_vpaes_set_encrypt_key:
|
---|
634 | mov rdi,rcx
|
---|
635 | mov rsi,rdx
|
---|
636 | mov rdx,r8
|
---|
637 |
|
---|
638 |
|
---|
639 |
|
---|
640 | DB 243,15,30,250
|
---|
641 | lea rsp,[((-184))+rsp]
|
---|
642 | movaps XMMWORD[16+rsp],xmm6
|
---|
643 | movaps XMMWORD[32+rsp],xmm7
|
---|
644 | movaps XMMWORD[48+rsp],xmm8
|
---|
645 | movaps XMMWORD[64+rsp],xmm9
|
---|
646 | movaps XMMWORD[80+rsp],xmm10
|
---|
647 | movaps XMMWORD[96+rsp],xmm11
|
---|
648 | movaps XMMWORD[112+rsp],xmm12
|
---|
649 | movaps XMMWORD[128+rsp],xmm13
|
---|
650 | movaps XMMWORD[144+rsp],xmm14
|
---|
651 | movaps XMMWORD[160+rsp],xmm15
|
---|
652 | $L$enc_key_body:
|
---|
653 | mov eax,esi
|
---|
654 | shr eax,5
|
---|
655 | add eax,5
|
---|
656 | mov DWORD[240+rdx],eax
|
---|
657 |
|
---|
658 | mov ecx,0
|
---|
659 | mov r8d,0x30
|
---|
660 | call _vpaes_schedule_core
|
---|
661 | movaps xmm6,XMMWORD[16+rsp]
|
---|
662 | movaps xmm7,XMMWORD[32+rsp]
|
---|
663 | movaps xmm8,XMMWORD[48+rsp]
|
---|
664 | movaps xmm9,XMMWORD[64+rsp]
|
---|
665 | movaps xmm10,XMMWORD[80+rsp]
|
---|
666 | movaps xmm11,XMMWORD[96+rsp]
|
---|
667 | movaps xmm12,XMMWORD[112+rsp]
|
---|
668 | movaps xmm13,XMMWORD[128+rsp]
|
---|
669 | movaps xmm14,XMMWORD[144+rsp]
|
---|
670 | movaps xmm15,XMMWORD[160+rsp]
|
---|
671 | lea rsp,[184+rsp]
|
---|
672 | $L$enc_key_epilogue:
|
---|
673 | xor eax,eax
|
---|
674 | mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
---|
675 | mov rsi,QWORD[16+rsp]
|
---|
676 | DB 0F3h,0C3h ;repret
|
---|
677 |
|
---|
678 | $L$SEH_end_vpaes_set_encrypt_key:
|
---|
679 |
|
---|
680 | global vpaes_set_decrypt_key
|
---|
681 |
|
---|
682 | ALIGN 16
|
---|
683 | vpaes_set_decrypt_key:
|
---|
684 | mov QWORD[8+rsp],rdi ;WIN64 prologue
|
---|
685 | mov QWORD[16+rsp],rsi
|
---|
686 | mov rax,rsp
|
---|
687 | $L$SEH_begin_vpaes_set_decrypt_key:
|
---|
688 | mov rdi,rcx
|
---|
689 | mov rsi,rdx
|
---|
690 | mov rdx,r8
|
---|
691 |
|
---|
692 |
|
---|
693 |
|
---|
694 | DB 243,15,30,250
|
---|
695 | lea rsp,[((-184))+rsp]
|
---|
696 | movaps XMMWORD[16+rsp],xmm6
|
---|
697 | movaps XMMWORD[32+rsp],xmm7
|
---|
698 | movaps XMMWORD[48+rsp],xmm8
|
---|
699 | movaps XMMWORD[64+rsp],xmm9
|
---|
700 | movaps XMMWORD[80+rsp],xmm10
|
---|
701 | movaps XMMWORD[96+rsp],xmm11
|
---|
702 | movaps XMMWORD[112+rsp],xmm12
|
---|
703 | movaps XMMWORD[128+rsp],xmm13
|
---|
704 | movaps XMMWORD[144+rsp],xmm14
|
---|
705 | movaps XMMWORD[160+rsp],xmm15
|
---|
706 | $L$dec_key_body:
|
---|
707 | mov eax,esi
|
---|
708 | shr eax,5
|
---|
709 | add eax,5
|
---|
710 | mov DWORD[240+rdx],eax
|
---|
711 | shl eax,4
|
---|
712 | lea rdx,[16+rax*1+rdx]
|
---|
713 |
|
---|
714 | mov ecx,1
|
---|
715 | mov r8d,esi
|
---|
716 | shr r8d,1
|
---|
717 | and r8d,32
|
---|
718 | xor r8d,32
|
---|
719 | call _vpaes_schedule_core
|
---|
720 | movaps xmm6,XMMWORD[16+rsp]
|
---|
721 | movaps xmm7,XMMWORD[32+rsp]
|
---|
722 | movaps xmm8,XMMWORD[48+rsp]
|
---|
723 | movaps xmm9,XMMWORD[64+rsp]
|
---|
724 | movaps xmm10,XMMWORD[80+rsp]
|
---|
725 | movaps xmm11,XMMWORD[96+rsp]
|
---|
726 | movaps xmm12,XMMWORD[112+rsp]
|
---|
727 | movaps xmm13,XMMWORD[128+rsp]
|
---|
728 | movaps xmm14,XMMWORD[144+rsp]
|
---|
729 | movaps xmm15,XMMWORD[160+rsp]
|
---|
730 | lea rsp,[184+rsp]
|
---|
731 | $L$dec_key_epilogue:
|
---|
732 | xor eax,eax
|
---|
733 | mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
---|
734 | mov rsi,QWORD[16+rsp]
|
---|
735 | DB 0F3h,0C3h ;repret
|
---|
736 |
|
---|
737 | $L$SEH_end_vpaes_set_decrypt_key:
|
---|
738 |
|
---|
739 | global vpaes_encrypt
|
---|
740 |
|
---|
741 | ALIGN 16
|
---|
742 | vpaes_encrypt:
|
---|
743 | mov QWORD[8+rsp],rdi ;WIN64 prologue
|
---|
744 | mov QWORD[16+rsp],rsi
|
---|
745 | mov rax,rsp
|
---|
746 | $L$SEH_begin_vpaes_encrypt:
|
---|
747 | mov rdi,rcx
|
---|
748 | mov rsi,rdx
|
---|
749 | mov rdx,r8
|
---|
750 |
|
---|
751 |
|
---|
752 |
|
---|
753 | DB 243,15,30,250
|
---|
754 | lea rsp,[((-184))+rsp]
|
---|
755 | movaps XMMWORD[16+rsp],xmm6
|
---|
756 | movaps XMMWORD[32+rsp],xmm7
|
---|
757 | movaps XMMWORD[48+rsp],xmm8
|
---|
758 | movaps XMMWORD[64+rsp],xmm9
|
---|
759 | movaps XMMWORD[80+rsp],xmm10
|
---|
760 | movaps XMMWORD[96+rsp],xmm11
|
---|
761 | movaps XMMWORD[112+rsp],xmm12
|
---|
762 | movaps XMMWORD[128+rsp],xmm13
|
---|
763 | movaps XMMWORD[144+rsp],xmm14
|
---|
764 | movaps XMMWORD[160+rsp],xmm15
|
---|
765 | $L$enc_body:
|
---|
766 | movdqu xmm0,XMMWORD[rdi]
|
---|
767 | call _vpaes_preheat
|
---|
768 | call _vpaes_encrypt_core
|
---|
769 | movdqu XMMWORD[rsi],xmm0
|
---|
770 | movaps xmm6,XMMWORD[16+rsp]
|
---|
771 | movaps xmm7,XMMWORD[32+rsp]
|
---|
772 | movaps xmm8,XMMWORD[48+rsp]
|
---|
773 | movaps xmm9,XMMWORD[64+rsp]
|
---|
774 | movaps xmm10,XMMWORD[80+rsp]
|
---|
775 | movaps xmm11,XMMWORD[96+rsp]
|
---|
776 | movaps xmm12,XMMWORD[112+rsp]
|
---|
777 | movaps xmm13,XMMWORD[128+rsp]
|
---|
778 | movaps xmm14,XMMWORD[144+rsp]
|
---|
779 | movaps xmm15,XMMWORD[160+rsp]
|
---|
780 | lea rsp,[184+rsp]
|
---|
781 | $L$enc_epilogue:
|
---|
782 | mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
---|
783 | mov rsi,QWORD[16+rsp]
|
---|
784 | DB 0F3h,0C3h ;repret
|
---|
785 |
|
---|
786 | $L$SEH_end_vpaes_encrypt:
|
---|
787 |
|
---|
788 | global vpaes_decrypt
|
---|
789 |
|
---|
790 | ALIGN 16
|
---|
791 | vpaes_decrypt:
|
---|
792 | mov QWORD[8+rsp],rdi ;WIN64 prologue
|
---|
793 | mov QWORD[16+rsp],rsi
|
---|
794 | mov rax,rsp
|
---|
795 | $L$SEH_begin_vpaes_decrypt:
|
---|
796 | mov rdi,rcx
|
---|
797 | mov rsi,rdx
|
---|
798 | mov rdx,r8
|
---|
799 |
|
---|
800 |
|
---|
801 |
|
---|
802 | DB 243,15,30,250
|
---|
803 | lea rsp,[((-184))+rsp]
|
---|
804 | movaps XMMWORD[16+rsp],xmm6
|
---|
805 | movaps XMMWORD[32+rsp],xmm7
|
---|
806 | movaps XMMWORD[48+rsp],xmm8
|
---|
807 | movaps XMMWORD[64+rsp],xmm9
|
---|
808 | movaps XMMWORD[80+rsp],xmm10
|
---|
809 | movaps XMMWORD[96+rsp],xmm11
|
---|
810 | movaps XMMWORD[112+rsp],xmm12
|
---|
811 | movaps XMMWORD[128+rsp],xmm13
|
---|
812 | movaps XMMWORD[144+rsp],xmm14
|
---|
813 | movaps XMMWORD[160+rsp],xmm15
|
---|
814 | $L$dec_body:
|
---|
815 | movdqu xmm0,XMMWORD[rdi]
|
---|
816 | call _vpaes_preheat
|
---|
817 | call _vpaes_decrypt_core
|
---|
818 | movdqu XMMWORD[rsi],xmm0
|
---|
819 | movaps xmm6,XMMWORD[16+rsp]
|
---|
820 | movaps xmm7,XMMWORD[32+rsp]
|
---|
821 | movaps xmm8,XMMWORD[48+rsp]
|
---|
822 | movaps xmm9,XMMWORD[64+rsp]
|
---|
823 | movaps xmm10,XMMWORD[80+rsp]
|
---|
824 | movaps xmm11,XMMWORD[96+rsp]
|
---|
825 | movaps xmm12,XMMWORD[112+rsp]
|
---|
826 | movaps xmm13,XMMWORD[128+rsp]
|
---|
827 | movaps xmm14,XMMWORD[144+rsp]
|
---|
828 | movaps xmm15,XMMWORD[160+rsp]
|
---|
829 | lea rsp,[184+rsp]
|
---|
830 | $L$dec_epilogue:
|
---|
831 | mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
---|
832 | mov rsi,QWORD[16+rsp]
|
---|
833 | DB 0F3h,0C3h ;repret
|
---|
834 |
|
---|
835 | $L$SEH_end_vpaes_decrypt:
|
---|
836 | global vpaes_cbc_encrypt
|
---|
837 |
|
---|
838 | ALIGN 16
|
---|
839 | vpaes_cbc_encrypt:
|
---|
840 | mov QWORD[8+rsp],rdi ;WIN64 prologue
|
---|
841 | mov QWORD[16+rsp],rsi
|
---|
842 | mov rax,rsp
|
---|
843 | $L$SEH_begin_vpaes_cbc_encrypt:
|
---|
844 | mov rdi,rcx
|
---|
845 | mov rsi,rdx
|
---|
846 | mov rdx,r8
|
---|
847 | mov rcx,r9
|
---|
848 | mov r8,QWORD[40+rsp]
|
---|
849 | mov r9,QWORD[48+rsp]
|
---|
850 |
|
---|
851 |
|
---|
852 |
|
---|
853 | DB 243,15,30,250
|
---|
854 | xchg rdx,rcx
|
---|
855 | sub rcx,16
|
---|
856 | jc NEAR $L$cbc_abort
|
---|
857 | lea rsp,[((-184))+rsp]
|
---|
858 | movaps XMMWORD[16+rsp],xmm6
|
---|
859 | movaps XMMWORD[32+rsp],xmm7
|
---|
860 | movaps XMMWORD[48+rsp],xmm8
|
---|
861 | movaps XMMWORD[64+rsp],xmm9
|
---|
862 | movaps XMMWORD[80+rsp],xmm10
|
---|
863 | movaps XMMWORD[96+rsp],xmm11
|
---|
864 | movaps XMMWORD[112+rsp],xmm12
|
---|
865 | movaps XMMWORD[128+rsp],xmm13
|
---|
866 | movaps XMMWORD[144+rsp],xmm14
|
---|
867 | movaps XMMWORD[160+rsp],xmm15
|
---|
868 | $L$cbc_body:
|
---|
869 | movdqu xmm6,XMMWORD[r8]
|
---|
870 | sub rsi,rdi
|
---|
871 | call _vpaes_preheat
|
---|
872 | cmp r9d,0
|
---|
873 | je NEAR $L$cbc_dec_loop
|
---|
874 | jmp NEAR $L$cbc_enc_loop
|
---|
875 | ALIGN 16
|
---|
876 | $L$cbc_enc_loop:
|
---|
877 | movdqu xmm0,XMMWORD[rdi]
|
---|
878 | pxor xmm0,xmm6
|
---|
879 | call _vpaes_encrypt_core
|
---|
880 | movdqa xmm6,xmm0
|
---|
881 | movdqu XMMWORD[rdi*1+rsi],xmm0
|
---|
882 | lea rdi,[16+rdi]
|
---|
883 | sub rcx,16
|
---|
884 | jnc NEAR $L$cbc_enc_loop
|
---|
885 | jmp NEAR $L$cbc_done
|
---|
886 | ALIGN 16
|
---|
887 | $L$cbc_dec_loop:
|
---|
888 | movdqu xmm0,XMMWORD[rdi]
|
---|
889 | movdqa xmm7,xmm0
|
---|
890 | call _vpaes_decrypt_core
|
---|
891 | pxor xmm0,xmm6
|
---|
892 | movdqa xmm6,xmm7
|
---|
893 | movdqu XMMWORD[rdi*1+rsi],xmm0
|
---|
894 | lea rdi,[16+rdi]
|
---|
895 | sub rcx,16
|
---|
896 | jnc NEAR $L$cbc_dec_loop
|
---|
897 | $L$cbc_done:
|
---|
898 | movdqu XMMWORD[r8],xmm6
|
---|
899 | movaps xmm6,XMMWORD[16+rsp]
|
---|
900 | movaps xmm7,XMMWORD[32+rsp]
|
---|
901 | movaps xmm8,XMMWORD[48+rsp]
|
---|
902 | movaps xmm9,XMMWORD[64+rsp]
|
---|
903 | movaps xmm10,XMMWORD[80+rsp]
|
---|
904 | movaps xmm11,XMMWORD[96+rsp]
|
---|
905 | movaps xmm12,XMMWORD[112+rsp]
|
---|
906 | movaps xmm13,XMMWORD[128+rsp]
|
---|
907 | movaps xmm14,XMMWORD[144+rsp]
|
---|
908 | movaps xmm15,XMMWORD[160+rsp]
|
---|
909 | lea rsp,[184+rsp]
|
---|
910 | $L$cbc_epilogue:
|
---|
911 | $L$cbc_abort:
|
---|
912 | mov rdi,QWORD[8+rsp] ;WIN64 epilogue
|
---|
913 | mov rsi,QWORD[16+rsp]
|
---|
914 | DB 0F3h,0C3h ;repret
|
---|
915 |
|
---|
916 | $L$SEH_end_vpaes_cbc_encrypt:
|
---|
917 |
|
---|
918 |
|
---|
919 |
|
---|
920 |
|
---|
921 |
|
---|
922 |
|
---|
923 |
|
---|
924 | ALIGN 16
|
---|
925 | _vpaes_preheat:
|
---|
926 |
|
---|
927 | lea r10,[$L$k_s0F]
|
---|
928 | movdqa xmm10,XMMWORD[((-32))+r10]
|
---|
929 | movdqa xmm11,XMMWORD[((-16))+r10]
|
---|
930 | movdqa xmm9,XMMWORD[r10]
|
---|
931 | movdqa xmm13,XMMWORD[48+r10]
|
---|
932 | movdqa xmm12,XMMWORD[64+r10]
|
---|
933 | movdqa xmm15,XMMWORD[80+r10]
|
---|
934 | movdqa xmm14,XMMWORD[96+r10]
|
---|
935 | DB 0F3h,0C3h ;repret
|
---|
936 |
|
---|
937 |
|
---|
938 |
|
---|
939 |
|
---|
940 |
|
---|
941 |
|
---|
942 |
|
---|
943 |
|
---|
944 | ALIGN 64
|
---|
945 | _vpaes_consts:
|
---|
946 | $L$k_inv:
|
---|
947 | DQ 0x0E05060F0D080180,0x040703090A0B0C02
|
---|
948 | DQ 0x01040A060F0B0780,0x030D0E0C02050809
|
---|
949 |
|
---|
950 | $L$k_s0F:
|
---|
951 | DQ 0x0F0F0F0F0F0F0F0F,0x0F0F0F0F0F0F0F0F
|
---|
952 |
|
---|
953 | $L$k_ipt:
|
---|
954 | DQ 0xC2B2E8985A2A7000,0xCABAE09052227808
|
---|
955 | DQ 0x4C01307D317C4D00,0xCD80B1FCB0FDCC81
|
---|
956 |
|
---|
957 | $L$k_sb1:
|
---|
958 | DQ 0xB19BE18FCB503E00,0xA5DF7A6E142AF544
|
---|
959 | DQ 0x3618D415FAE22300,0x3BF7CCC10D2ED9EF
|
---|
960 | $L$k_sb2:
|
---|
961 | DQ 0xE27A93C60B712400,0x5EB7E955BC982FCD
|
---|
962 | DQ 0x69EB88400AE12900,0xC2A163C8AB82234A
|
---|
963 | $L$k_sbo:
|
---|
964 | DQ 0xD0D26D176FBDC700,0x15AABF7AC502A878
|
---|
965 | DQ 0xCFE474A55FBB6A00,0x8E1E90D1412B35FA
|
---|
966 |
|
---|
967 | $L$k_mc_forward:
|
---|
968 | DQ 0x0407060500030201,0x0C0F0E0D080B0A09
|
---|
969 | DQ 0x080B0A0904070605,0x000302010C0F0E0D
|
---|
970 | DQ 0x0C0F0E0D080B0A09,0x0407060500030201
|
---|
971 | DQ 0x000302010C0F0E0D,0x080B0A0904070605
|
---|
972 |
|
---|
973 | $L$k_mc_backward:
|
---|
974 | DQ 0x0605040702010003,0x0E0D0C0F0A09080B
|
---|
975 | DQ 0x020100030E0D0C0F,0x0A09080B06050407
|
---|
976 | DQ 0x0E0D0C0F0A09080B,0x0605040702010003
|
---|
977 | DQ 0x0A09080B06050407,0x020100030E0D0C0F
|
---|
978 |
|
---|
979 | $L$k_sr:
|
---|
980 | DQ 0x0706050403020100,0x0F0E0D0C0B0A0908
|
---|
981 | DQ 0x030E09040F0A0500,0x0B06010C07020D08
|
---|
982 | DQ 0x0F060D040B020900,0x070E050C030A0108
|
---|
983 | DQ 0x0B0E0104070A0D00,0x0306090C0F020508
|
---|
984 |
|
---|
985 | $L$k_rcon:
|
---|
986 | DQ 0x1F8391B9AF9DEEB6,0x702A98084D7C7D81
|
---|
987 |
|
---|
988 | $L$k_s63:
|
---|
989 | DQ 0x5B5B5B5B5B5B5B5B,0x5B5B5B5B5B5B5B5B
|
---|
990 |
|
---|
991 | $L$k_opt:
|
---|
992 | DQ 0xFF9F4929D6B66000,0xF7974121DEBE6808
|
---|
993 | DQ 0x01EDBD5150BCEC00,0xE10D5DB1B05C0CE0
|
---|
994 |
|
---|
995 | $L$k_deskew:
|
---|
996 | DQ 0x07E4A34047A4E300,0x1DFEB95A5DBEF91A
|
---|
997 | DQ 0x5F36B5DC83EA6900,0x2841C2ABF49D1E77
|
---|
998 |
|
---|
999 |
|
---|
1000 |
|
---|
1001 |
|
---|
1002 |
|
---|
1003 | $L$k_dksd:
|
---|
1004 | DQ 0xFEB91A5DA3E44700,0x0740E3A45A1DBEF9
|
---|
1005 | DQ 0x41C277F4B5368300,0x5FDC69EAAB289D1E
|
---|
1006 | $L$k_dksb:
|
---|
1007 | DQ 0x9A4FCA1F8550D500,0x03D653861CC94C99
|
---|
1008 | DQ 0x115BEDA7B6FC4A00,0xD993256F7E3482C8
|
---|
1009 | $L$k_dkse:
|
---|
1010 | DQ 0xD5031CCA1FC9D600,0x53859A4C994F5086
|
---|
1011 | DQ 0xA23196054FDC7BE8,0xCD5EF96A20B31487
|
---|
1012 | $L$k_dks9:
|
---|
1013 | DQ 0xB6116FC87ED9A700,0x4AED933482255BFC
|
---|
1014 | DQ 0x4576516227143300,0x8BB89FACE9DAFDCE
|
---|
1015 |
|
---|
1016 |
|
---|
1017 |
|
---|
1018 |
|
---|
1019 |
|
---|
1020 | $L$k_dipt:
|
---|
1021 | DQ 0x0F505B040B545F00,0x154A411E114E451A
|
---|
1022 | DQ 0x86E383E660056500,0x12771772F491F194
|
---|
1023 |
|
---|
1024 | $L$k_dsb9:
|
---|
1025 | DQ 0x851C03539A86D600,0xCAD51F504F994CC9
|
---|
1026 | DQ 0xC03B1789ECD74900,0x725E2C9EB2FBA565
|
---|
1027 | $L$k_dsbd:
|
---|
1028 | DQ 0x7D57CCDFE6B1A200,0xF56E9B13882A4439
|
---|
1029 | DQ 0x3CE2FAF724C6CB00,0x2931180D15DEEFD3
|
---|
1030 | $L$k_dsbb:
|
---|
1031 | DQ 0xD022649296B44200,0x602646F6B0F2D404
|
---|
1032 | DQ 0xC19498A6CD596700,0xF3FF0C3E3255AA6B
|
---|
1033 | $L$k_dsbe:
|
---|
1034 | DQ 0x46F2929626D4D000,0x2242600464B4F6B0
|
---|
1035 | DQ 0x0C55A6CDFFAAC100,0x9467F36B98593E32
|
---|
1036 | $L$k_dsbo:
|
---|
1037 | DQ 0x1387EA537EF94000,0xC7AA6DB9D4943E2D
|
---|
1038 | DQ 0x12D7560F93441D00,0xCA4B8159D8C58E9C
|
---|
1039 | DB 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
|
---|
1040 | DB 111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54
|
---|
1041 | DB 52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97
|
---|
1042 | DB 109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32
|
---|
1043 | DB 85,110,105,118,101,114,115,105,116,121,41,0
|
---|
1044 | ALIGN 64
|
---|
1045 |
|
---|
1046 | EXTERN __imp_RtlVirtualUnwind
|
---|
1047 |
|
---|
1048 | ALIGN 16
|
---|
1049 | se_handler:
|
---|
1050 | push rsi
|
---|
1051 | push rdi
|
---|
1052 | push rbx
|
---|
1053 | push rbp
|
---|
1054 | push r12
|
---|
1055 | push r13
|
---|
1056 | push r14
|
---|
1057 | push r15
|
---|
1058 | pushfq
|
---|
1059 | sub rsp,64
|
---|
1060 |
|
---|
1061 | mov rax,QWORD[120+r8]
|
---|
1062 | mov rbx,QWORD[248+r8]
|
---|
1063 |
|
---|
1064 | mov rsi,QWORD[8+r9]
|
---|
1065 | mov r11,QWORD[56+r9]
|
---|
1066 |
|
---|
1067 | mov r10d,DWORD[r11]
|
---|
1068 | lea r10,[r10*1+rsi]
|
---|
1069 | cmp rbx,r10
|
---|
1070 | jb NEAR $L$in_prologue
|
---|
1071 |
|
---|
1072 | mov rax,QWORD[152+r8]
|
---|
1073 |
|
---|
1074 | mov r10d,DWORD[4+r11]
|
---|
1075 | lea r10,[r10*1+rsi]
|
---|
1076 | cmp rbx,r10
|
---|
1077 | jae NEAR $L$in_prologue
|
---|
1078 |
|
---|
1079 | lea rsi,[16+rax]
|
---|
1080 | lea rdi,[512+r8]
|
---|
1081 | mov ecx,20
|
---|
1082 | DD 0xa548f3fc
|
---|
1083 | lea rax,[184+rax]
|
---|
1084 |
|
---|
1085 | $L$in_prologue:
|
---|
1086 | mov rdi,QWORD[8+rax]
|
---|
1087 | mov rsi,QWORD[16+rax]
|
---|
1088 | mov QWORD[152+r8],rax
|
---|
1089 | mov QWORD[168+r8],rsi
|
---|
1090 | mov QWORD[176+r8],rdi
|
---|
1091 |
|
---|
1092 | mov rdi,QWORD[40+r9]
|
---|
1093 | mov rsi,r8
|
---|
1094 | mov ecx,154
|
---|
1095 | DD 0xa548f3fc
|
---|
1096 |
|
---|
1097 | mov rsi,r9
|
---|
1098 | xor rcx,rcx
|
---|
1099 | mov rdx,QWORD[8+rsi]
|
---|
1100 | mov r8,QWORD[rsi]
|
---|
1101 | mov r9,QWORD[16+rsi]
|
---|
1102 | mov r10,QWORD[40+rsi]
|
---|
1103 | lea r11,[56+rsi]
|
---|
1104 | lea r12,[24+rsi]
|
---|
1105 | mov QWORD[32+rsp],r10
|
---|
1106 | mov QWORD[40+rsp],r11
|
---|
1107 | mov QWORD[48+rsp],r12
|
---|
1108 | mov QWORD[56+rsp],rcx
|
---|
1109 | call QWORD[__imp_RtlVirtualUnwind]
|
---|
1110 |
|
---|
1111 | mov eax,1
|
---|
1112 | add rsp,64
|
---|
1113 | popfq
|
---|
1114 | pop r15
|
---|
1115 | pop r14
|
---|
1116 | pop r13
|
---|
1117 | pop r12
|
---|
1118 | pop rbp
|
---|
1119 | pop rbx
|
---|
1120 | pop rdi
|
---|
1121 | pop rsi
|
---|
1122 | DB 0F3h,0C3h ;repret
|
---|
1123 |
|
---|
1124 |
|
---|
1125 | section .pdata rdata align=4
|
---|
1126 | ALIGN 4
|
---|
1127 | DD $L$SEH_begin_vpaes_set_encrypt_key wrt ..imagebase
|
---|
1128 | DD $L$SEH_end_vpaes_set_encrypt_key wrt ..imagebase
|
---|
1129 | DD $L$SEH_info_vpaes_set_encrypt_key wrt ..imagebase
|
---|
1130 |
|
---|
1131 | DD $L$SEH_begin_vpaes_set_decrypt_key wrt ..imagebase
|
---|
1132 | DD $L$SEH_end_vpaes_set_decrypt_key wrt ..imagebase
|
---|
1133 | DD $L$SEH_info_vpaes_set_decrypt_key wrt ..imagebase
|
---|
1134 |
|
---|
1135 | DD $L$SEH_begin_vpaes_encrypt wrt ..imagebase
|
---|
1136 | DD $L$SEH_end_vpaes_encrypt wrt ..imagebase
|
---|
1137 | DD $L$SEH_info_vpaes_encrypt wrt ..imagebase
|
---|
1138 |
|
---|
1139 | DD $L$SEH_begin_vpaes_decrypt wrt ..imagebase
|
---|
1140 | DD $L$SEH_end_vpaes_decrypt wrt ..imagebase
|
---|
1141 | DD $L$SEH_info_vpaes_decrypt wrt ..imagebase
|
---|
1142 |
|
---|
1143 | DD $L$SEH_begin_vpaes_cbc_encrypt wrt ..imagebase
|
---|
1144 | DD $L$SEH_end_vpaes_cbc_encrypt wrt ..imagebase
|
---|
1145 | DD $L$SEH_info_vpaes_cbc_encrypt wrt ..imagebase
|
---|
1146 |
|
---|
1147 | section .xdata rdata align=8
|
---|
1148 | ALIGN 8
|
---|
1149 | $L$SEH_info_vpaes_set_encrypt_key:
|
---|
1150 | DB 9,0,0,0
|
---|
1151 | DD se_handler wrt ..imagebase
|
---|
1152 | DD $L$enc_key_body wrt ..imagebase,$L$enc_key_epilogue wrt ..imagebase
|
---|
1153 | $L$SEH_info_vpaes_set_decrypt_key:
|
---|
1154 | DB 9,0,0,0
|
---|
1155 | DD se_handler wrt ..imagebase
|
---|
1156 | DD $L$dec_key_body wrt ..imagebase,$L$dec_key_epilogue wrt ..imagebase
|
---|
1157 | $L$SEH_info_vpaes_encrypt:
|
---|
1158 | DB 9,0,0,0
|
---|
1159 | DD se_handler wrt ..imagebase
|
---|
1160 | DD $L$enc_body wrt ..imagebase,$L$enc_epilogue wrt ..imagebase
|
---|
1161 | $L$SEH_info_vpaes_decrypt:
|
---|
1162 | DB 9,0,0,0
|
---|
1163 | DD se_handler wrt ..imagebase
|
---|
1164 | DD $L$dec_body wrt ..imagebase,$L$dec_epilogue wrt ..imagebase
|
---|
1165 | $L$SEH_info_vpaes_cbc_encrypt:
|
---|
1166 | DB 9,0,0,0
|
---|
1167 | DD se_handler wrt ..imagebase
|
---|
1168 | DD $L$cbc_body wrt ..imagebase,$L$cbc_epilogue wrt ..imagebase
|
---|