5 section .text code
align=64
7 EXTERN OPENSSL_ia32cap_P
13 mov QWORD[8+rsp
],rdi
;WIN64 prologue
25 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
40 mov r10b
,BYTE[((-8))+rdi
]
41 mov cl,BYTE[((-4))+rdi
]
44 mov r8d
,DWORD[OPENSSL_ia32cap_P
]
49 mov eax,DWORD[r10
*4+rdi
]
60 mov edx,DWORD[rcx
*4+rdi
]
61 mov DWORD[rcx
*4+rdi
],eax
62 mov DWORD[r10
*4+rdi
],edx
65 mov edx,DWORD[rax
*4+rdi
]
66 mov eax,DWORD[r10
*4+rdi
]
68 mov BYTE[r13
*1+r12
],dl
71 jnz NEAR $L$oop8_warmup
78 mov edx,DWORD[rcx
*4+rdi
]
79 mov DWORD[rcx
*4+rdi
],eax
80 mov ebx,DWORD[rsi
*4+rdi
]
82 mov DWORD[r10
*4+rdi
],edx
84 mov r8b
,BYTE[rdx
*4+rdi
]
86 mov edx,DWORD[rcx
*4+rdi
]
87 mov DWORD[rcx
*4+rdi
],ebx
88 mov eax,DWORD[4+rsi
*4+rdi
]
90 mov DWORD[4+r10
*4+rdi
],edx
92 mov r8b
,BYTE[rdx
*4+rdi
]
94 mov edx,DWORD[rcx
*4+rdi
]
95 mov DWORD[rcx
*4+rdi
],eax
96 mov ebx,DWORD[8+rsi
*4+rdi
]
98 mov DWORD[8+r10
*4+rdi
],edx
100 mov r8b
,BYTE[rdx
*4+rdi
]
102 mov edx,DWORD[rcx
*4+rdi
]
103 mov DWORD[rcx
*4+rdi
],ebx
104 mov eax,DWORD[12+rsi
*4+rdi
]
106 mov DWORD[12+r10
*4+rdi
],edx
108 mov r8b
,BYTE[rdx
*4+rdi
]
110 mov edx,DWORD[rcx
*4+rdi
]
111 mov DWORD[rcx
*4+rdi
],eax
112 mov ebx,DWORD[16+rsi
*4+rdi
]
114 mov DWORD[16+r10
*4+rdi
],edx
116 mov r8b
,BYTE[rdx
*4+rdi
]
118 mov edx,DWORD[rcx
*4+rdi
]
119 mov DWORD[rcx
*4+rdi
],ebx
120 mov eax,DWORD[20+rsi
*4+rdi
]
122 mov DWORD[20+r10
*4+rdi
],edx
124 mov r8b
,BYTE[rdx
*4+rdi
]
126 mov edx,DWORD[rcx
*4+rdi
]
127 mov DWORD[rcx
*4+rdi
],eax
128 mov ebx,DWORD[24+rsi
*4+rdi
]
130 mov DWORD[24+r10
*4+rdi
],edx
132 mov r8b
,BYTE[rdx
*4+rdi
]
135 mov edx,DWORD[rcx
*4+rdi
]
136 mov DWORD[rcx
*4+rdi
],ebx
137 mov eax,DWORD[((-4))+rsi
*4+rdi
]
139 mov DWORD[28+r10
*4+rdi
],edx
141 mov r8b
,BYTE[rdx
*4+rdi
]
147 mov QWORD[r13
*1+r12
],r8
161 jz NEAR $L$oop16_is_hot
165 mov edx,DWORD[rcx
*4+rdi
]
166 mov DWORD[rcx
*4+rdi
],eax
167 mov DWORD[r10
*4+rdi
],edx
170 mov edx,DWORD[rax
*4+rdi
]
171 mov eax,DWORD[r10
*4+rdi
]
173 mov BYTE[r13
*1+r12
],dl
176 jnz NEAR $L$oop16_warmup
185 mov edx,DWORD[rcx
*4+rdi
]
187 mov DWORD[rcx
*4+rdi
],eax
193 pinsrw xmm0
,WORD[rax
*4+rdi
],0
194 jmp NEAR $L$oop16_enter
198 mov edx,DWORD[rcx
*4+rdi
]
202 mov DWORD[rcx
*4+rdi
],eax
209 pinsrw xmm0
,WORD[rax
*4+rdi
],0
210 movdqu XMMWORD
[r13
*1+r12
],xmm2
213 mov edx,DWORD[rcx
*4+rdi
]
215 mov DWORD[rcx
*4+rdi
],ebx
221 pinsrw xmm1
,WORD[rbx
*4+rdi
],0
222 mov edx,DWORD[rcx
*4+rdi
]
223 mov DWORD[rcx
*4+rdi
],eax
225 mov ebx,DWORD[12+rsi
]
229 pinsrw xmm0
,WORD[rax
*4+rdi
],1
230 mov edx,DWORD[rcx
*4+rdi
]
231 mov DWORD[rcx
*4+rdi
],ebx
233 mov eax,DWORD[16+rsi
]
235 mov DWORD[12+rsi
],edx
237 pinsrw xmm1
,WORD[rbx
*4+rdi
],1
238 mov edx,DWORD[rcx
*4+rdi
]
239 mov DWORD[rcx
*4+rdi
],eax
241 mov ebx,DWORD[20+rsi
]
243 mov DWORD[16+rsi
],edx
245 pinsrw xmm0
,WORD[rax
*4+rdi
],2
246 mov edx,DWORD[rcx
*4+rdi
]
247 mov DWORD[rcx
*4+rdi
],ebx
249 mov eax,DWORD[24+rsi
]
251 mov DWORD[20+rsi
],edx
253 pinsrw xmm1
,WORD[rbx
*4+rdi
],2
254 mov edx,DWORD[rcx
*4+rdi
]
255 mov DWORD[rcx
*4+rdi
],eax
257 mov ebx,DWORD[28+rsi
]
259 mov DWORD[24+rsi
],edx
261 pinsrw xmm0
,WORD[rax
*4+rdi
],3
262 mov edx,DWORD[rcx
*4+rdi
]
263 mov DWORD[rcx
*4+rdi
],ebx
265 mov eax,DWORD[32+rsi
]
267 mov DWORD[28+rsi
],edx
269 pinsrw xmm1
,WORD[rbx
*4+rdi
],3
270 mov edx,DWORD[rcx
*4+rdi
]
271 mov DWORD[rcx
*4+rdi
],eax
273 mov ebx,DWORD[36+rsi
]
275 mov DWORD[32+rsi
],edx
277 pinsrw xmm0
,WORD[rax
*4+rdi
],4
278 mov edx,DWORD[rcx
*4+rdi
]
279 mov DWORD[rcx
*4+rdi
],ebx
281 mov eax,DWORD[40+rsi
]
283 mov DWORD[36+rsi
],edx
285 pinsrw xmm1
,WORD[rbx
*4+rdi
],4
286 mov edx,DWORD[rcx
*4+rdi
]
287 mov DWORD[rcx
*4+rdi
],eax
289 mov ebx,DWORD[44+rsi
]
291 mov DWORD[40+rsi
],edx
293 pinsrw xmm0
,WORD[rax
*4+rdi
],5
294 mov edx,DWORD[rcx
*4+rdi
]
295 mov DWORD[rcx
*4+rdi
],ebx
297 mov eax,DWORD[48+rsi
]
299 mov DWORD[44+rsi
],edx
301 pinsrw xmm1
,WORD[rbx
*4+rdi
],5
302 mov edx,DWORD[rcx
*4+rdi
]
303 mov DWORD[rcx
*4+rdi
],eax
305 mov ebx,DWORD[52+rsi
]
307 mov DWORD[48+rsi
],edx
309 pinsrw xmm0
,WORD[rax
*4+rdi
],6
310 mov edx,DWORD[rcx
*4+rdi
]
311 mov DWORD[rcx
*4+rdi
],ebx
313 mov eax,DWORD[56+rsi
]
315 mov DWORD[52+rsi
],edx
317 pinsrw xmm1
,WORD[rbx
*4+rdi
],6
318 mov edx,DWORD[rcx
*4+rdi
]
319 mov DWORD[rcx
*4+rdi
],eax
321 mov ebx,DWORD[60+rsi
]
323 mov DWORD[56+rsi
],edx
325 pinsrw xmm0
,WORD[rax
*4+rdi
],7
327 movdqu xmm2
,XMMWORD
[r12
]
328 mov edx,DWORD[rcx
*4+rdi
]
329 mov DWORD[rcx
*4+rdi
],ebx
332 mov DWORD[60+rsi
],edx
334 pinsrw xmm1
,WORD[rbx
*4+rdi
],7
346 movdqu XMMWORD
[r13
*1+r12
],xmm2
356 mov edx,DWORD[rcx
*4+rdi
]
357 mov DWORD[rcx
*4+rdi
],eax
358 mov DWORD[r10
*4+rdi
],edx
361 mov edx,DWORD[rax
*4+rdi
]
362 mov eax,DWORD[r10
*4+rdi
]
364 mov BYTE[r13
*1+r12
],dl
373 movzx eax,BYTE[r10
*1+rdi
]
383 movzx edx,BYTE[rcx
*1+rdi
]
385 movzx ebx,BYTE[rsi
*1+rdi
]
386 mov BYTE[rcx
*1+rdi
],al
388 mov BYTE[r10
*1+rdi
],dl
393 xor r8b
,BYTE[rdx
*1+rdi
]
397 movzx edx,BYTE[rcx
*1+rdi
]
399 movzx eax,BYTE[r10
*1+rdi
]
400 mov BYTE[rcx
*1+rdi
],bl
402 mov BYTE[rsi
*1+rdi
],dl
407 xor r8b
,BYTE[rdx
*1+rdi
]
411 movzx edx,BYTE[rcx
*1+rdi
]
413 movzx ebx,BYTE[rsi
*1+rdi
]
414 mov BYTE[rcx
*1+rdi
],al
416 mov BYTE[r10
*1+rdi
],dl
421 xor r8b
,BYTE[rdx
*1+rdi
]
425 movzx edx,BYTE[rcx
*1+rdi
]
427 movzx eax,BYTE[r10
*1+rdi
]
428 mov BYTE[rcx
*1+rdi
],bl
430 mov BYTE[rsi
*1+rdi
],dl
435 xor r8b
,BYTE[rdx
*1+rdi
]
439 movzx edx,BYTE[rcx
*1+rdi
]
441 movzx ebx,BYTE[rsi
*1+rdi
]
442 mov BYTE[rcx
*1+rdi
],al
444 mov BYTE[r10
*1+rdi
],dl
449 xor r9b
,BYTE[rdx
*1+rdi
]
453 movzx edx,BYTE[rcx
*1+rdi
]
455 movzx eax,BYTE[r10
*1+rdi
]
456 mov BYTE[rcx
*1+rdi
],bl
458 mov BYTE[rsi
*1+rdi
],dl
463 xor r9b
,BYTE[rdx
*1+rdi
]
467 movzx edx,BYTE[rcx
*1+rdi
]
469 movzx ebx,BYTE[rsi
*1+rdi
]
470 mov BYTE[rcx
*1+rdi
],al
472 mov BYTE[r10
*1+rdi
],dl
477 xor r9b
,BYTE[rdx
*1+rdi
]
481 movzx edx,BYTE[rcx
*1+rdi
]
483 movzx eax,BYTE[r10
*1+rdi
]
484 mov BYTE[rcx
*1+rdi
],bl
486 mov BYTE[rsi
*1+rdi
],dl
491 xor r9b
,BYTE[rdx
*1+rdi
]
508 movzx edx,BYTE[rcx
*1+rdi
]
509 mov BYTE[rcx
*1+rdi
],al
510 mov BYTE[r10
*1+rdi
],dl
515 movzx edx,BYTE[rdx
*1+rdi
]
516 movzx eax,BYTE[r10
*1+rdi
]
528 mov DWORD[((-8))+rdi
],r10d
529 mov DWORD[((-4))+rdi
],ecx
533 mov rbx
,QWORD[16+rsp
]
536 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
537 mov rsi
,QWORD[16+rsp
]
540 global asm_RC4_set_key
544 mov QWORD[8+rsp
],rdi
;WIN64 prologue
545 mov QWORD[16+rsp
],rsi
547 $L$
SEH_begin_asm_RC4_set_key:
562 mov r8d
,DWORD[OPENSSL_ia32cap_P
]
569 mov DWORD[rax
*4+rdi
],eax
577 mov r10d
,DWORD[r9
*4+rdi
]
578 add r8b
,BYTE[rsi
*1+rdx
]
581 mov r11d
,DWORD[r8
*4+rdi
]
583 mov DWORD[r8
*4+rdi
],r10d
584 mov DWORD[r9
*4+rdi
],r11d
591 mov BYTE[rax
*1+rdi
],al
599 mov r10b
,BYTE[r9
*1+rdi
]
600 add r8b
,BYTE[rsi
*1+rdx
]
603 mov r11b
,BYTE[r8
*1+rdi
]
607 mov BYTE[r8
*1+rdi
],r10b
608 mov BYTE[r9
*1+rdi
],r11b
611 mov DWORD[256+rdi
],-1
616 mov DWORD[((-8))+rdi
],eax
617 mov DWORD[((-4))+rdi
],eax
618 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
619 mov rsi
,QWORD[16+rsp
]
621 $L$
SEH_end_asm_RC4_set_key:
622 EXTERN __imp_RtlVirtualUnwind
637 mov rax
,QWORD[120+r8
]
638 mov rbx
,QWORD[248+r8
]
640 lea r10
,[$L$prologue
]
642 jb NEAR $L$in_prologue
644 mov rax
,QWORD[152+r8
]
646 lea r10
,[$L
$epilogue
]
648 jae NEAR $L$in_prologue
652 mov rbx
,QWORD[((-8))+rax
]
653 mov r12
,QWORD[((-16))+rax
]
654 mov r13
,QWORD[((-24))+rax
]
655 mov QWORD[144+r8
],rbx
656 mov QWORD[216+r8
],r12
657 mov QWORD[224+r8
],r13
661 mov rsi
,QWORD[16+rax
]
662 mov QWORD[152+r8
],rax
663 mov QWORD[168+r8
],rsi
664 mov QWORD[176+r8
],rdi
666 jmp NEAR $L
$common_seh_exit
683 mov rax
,QWORD[152+r8
]
685 mov rsi
,QWORD[16+rax
]
686 mov QWORD[168+r8
],rsi
687 mov QWORD[176+r8
],rdi
701 mov r10
,QWORD[40+rsi
]
704 mov QWORD[32+rsp
],r10
705 mov QWORD[40+rsp
],r11
706 mov QWORD[48+rsp
],r12
707 mov QWORD[56+rsp
],rcx
708 call QWORD[__imp_RtlVirtualUnwind
]
724 section .pdata rdata
align=4
726 DD $L$SEH_begin_asm_RC4 wrt ..imagebase
727 DD $L$SEH_end_asm_RC4 wrt ..imagebase
728 DD $L$SEH_info_asm_RC4 wrt ..imagebase
730 DD $L$SEH_begin_asm_RC4_set_key wrt ..imagebase
731 DD $L$SEH_end_asm_RC4_set_key wrt ..imagebase
732 DD $L$SEH_info_asm_RC4_set_key wrt ..imagebase
734 section .xdata rdata
align=8
738 DD stream_se_handler wrt ..imagebase
739 $L$
SEH_info_asm_RC4_set_key:
741 DD key_se_handler wrt ..imagebase