.file "arcfour-crypt.asm" .text .align 4 .globl nettle_arcfour_crypt nettle_arcfour_crypt: pushl %ebx pushl %ebp pushl %esi pushl %edi movl 24(%esp), %edx testl %edx,%edx jz .Lend movl 20(%esp), %ebp movl 28(%esp), %edi movl 32(%esp), %esi addl %esi, %edx movzbl 256 (%ebp), %eax movzbl 257 (%ebp), %ebx .Lloop: incl %eax andl $0xff, %eax movzbl (%ebp, %eax), %ecx addb %cl, %bl movb (%ebp, %ebx), %ch movb %ch, (%ebp, %eax) movb %cl, (%ebp, %ebx) addb %ch, %cl movzbl %cl, %ecx movb (%ebp, %ecx), %cl xorb (%esi), %cl incl %esi movb %cl, (%edi) incl %edi cmpl %esi, %edx jne .Lloop movb %al, 256 (%ebp) movb %bl, 257 (%ebp) .Lend: popl %edi popl %esi popl %ebp popl %ebx ret