o
    <‘ði¨  ã                   @  s  d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z
 d d	lmZ d d
lmZ d dlmZmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZeje
edejdd ejeedejdd ejeedejdd G dd„ deƒZG dd„ deƒZdS )é    )Úannotations)Úutils)ÚARC4)ÚCAST5)ÚIDEA)ÚSEED)ÚBlowfish)ÚCamellia)Ú	TripleDES)Ú_verify_key_size)ÚBlockCipherAlgorithmÚCipherAlgorithmc                   @  s8   e Zd Zd ZdZeg d¢ƒZddd„Zedd	d
„ƒZ	dS )ÚAESé€   )r   éÀ   é   i   Úkeyúutils.Bufferc                 C  ó   t | |ƒ| _d S ©N©r   r   ©Úselfr   © r   úp/root/parts/websockify/install/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.pyÚ__init__*   ó   zAES.__init__ÚreturnÚintc                 C  ó   t | jƒd S ©Né   ©Úlenr   ©r   r   r   r   Úkey_size-   ó   zAES.key_sizeN©r   r   ©r   r   ©
Ú__name__Ú
__module__Ú__qualname__ÚnameÚ
block_sizeÚ	frozensetÚ	key_sizesr   Úpropertyr%   r   r   r   r   r   $   s    
r   c                   @  s,   e Zd ZdZdZedgƒZdZddd„ZdS )	ÚAES128r   r   r   r   c                 C  r   r   r   r   r   r   r   r   8   r   zAES128.__init__Nr'   ©	r*   r+   r,   r-   r.   r/   r0   r%   r   r   r   r   r   r2   2   ó    
r2   c                   @  s,   e Zd ZdZdZedgƒZdZd	dd„ZdS )
ÚAES256r   r   r   r   r   c                 C  r   r   r   r   r   r   r   r   B   r   zAES256.__init__Nr'   r3   r   r   r   r   r5   <   r4   r5   z©Camellia has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.Camellia and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 49.0.0.r	   )r-   z¡ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.r   z«TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.r
   c                   @  s@   e Zd Zd ZedgƒZddd„Zeddd	„ƒZeddd„ƒZ	dS )ÚChaCha20r   r   r   Únoncec                 C  s6   t | |ƒ| _t d|¡ t|ƒdkrtdƒ‚|| _d S )Nr7   é   z!nonce must be 128-bits (16 bytes))r   r   r   Ú_check_bytesliker#   Ú
ValueErrorÚ_nonce)r   r   r7   r   r   r   r   n   s
   
zChaCha20.__init__r   c                 C  s   | j S r   )r;   r$   r   r   r   r7   w   s   zChaCha20.noncer   c                 C  r   r    r"   r$   r   r   r   r%   {   r&   zChaCha20.key_sizeN)r   r   r7   r   )r   r   r(   )
r*   r+   r,   r-   r/   r0   r   r1   r7   r%   r   r   r   r   r6   j   s    

	r6   c                   @  s6   e Zd Zd ZdZedgƒZddd„Zeddd	„ƒZ	d
S )ÚSM4r   r   Úbytesc                 C  r   r   r   r   r   r   r   r   …   r   zSM4.__init__r   r   c                 C  r   r    r"   r$   r   r   r   r%   ˆ   r&   zSM4.key_sizeN)r   r=   r(   r)   r   r   r   r   r<   €   s    

r<   N)Ú
__future__r   Úcryptographyr   Ú/cryptography.hazmat.decrepit.ciphers.algorithmsr   r   r   r   r   r	   r
   Ú/cryptography.hazmat.primitives._cipheralgorithmr   Ú&cryptography.hazmat.primitives.ciphersr   r   r   r2   r5   Ú
deprecatedr*   ÚDeprecatedIn43r6   r<   r   r   r   r   Ú<module>   sJ   

øøø