o
    ¾Ùøi¡  ã                   @   s"   d Z ddlmZ G dd„ dƒZdS )z�Python implementation of Arcfour encryption algorithm.
See https://en.wikipedia.org/wiki/RC4
This code is in the public domain.

é    )ÚSequencec                   @   s<   e Zd Zdee ddfdd„Zdedefdd„Ze ZZ	dS )	ÚArcfourÚkeyÚreturnNc                 C   sr   t tdƒƒ}d}t|ƒ}tdƒD ]}|||  |||   d }|| || ||< ||< q|| _d\| _| _d S )Né   r   )r   r   )ÚlistÚrangeÚlenÚsÚiÚj)Úselfr   r
   r   Úklenr   © r   ú]/home/develop/edictos_py/central_edictos/env/lib/python3.10/site-packages/pdfminer/arcfour.pyÚ__init__   s   zArcfour.__init__Údatac                 C   s˜   | j | j}}| j}d}t|ƒD ]2}|d d }|||  d }|| || ||< ||< ||| ||  d  }|t||A fƒ7 }q||| _ | _|S )Nó    é   r   )r   r   r
   ÚiterÚbytes)r   r   r   r   r
   ÚrÚcÚkr   r   r   Úprocess   s   zArcfour.process)
Ú__name__Ú
__module__Ú__qualname__r   Úintr   r   r   ÚencryptÚdecryptr   r   r   r   r   
   s    r   N)Ú__doc__Úcollections.abcr   r   r   r   r   r   Ú<module>   s    