U
    ʹhO                     @  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mZ G dd de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 G dd deZG dd deZdS )    )annotations)utils)ARC4)CAST5)IDEA)SEED)Blowfish)	TripleDES)_verify_key_size)BlockCipherAlgorithmCipherAlgorithmc                   @  sD   e Zd Zd ZdZeddddgZddddZed	d
ddZ	dS )AES         i   utils.Bufferkeyc                 C  s   t | || _d S Nr
   r   selfr    r   W./venv/lib/python3.8/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py__init__'   s    zAES.__init__intreturnc                 C  s   t | jd S N   lenr   r   r   r   r   key_size*   s    zAES.key_sizeN
__name__
__module____qualname__name
block_size	frozenset	key_sizesr   propertyr#   r   r   r   r   r   !   s   r   c                   @  s0   e Zd ZdZdZedgZdZddddZdS )AES128r   r   r   r   c                 C  s   t | || _d S r   r   r   r   r   r   r   5   s    zAES128.__init__N	r%   r&   r'   r(   r)   r*   r+   r#   r   r   r   r   r   r-   /   s
   
r-   c                   @  s0   e Zd ZdZdZedgZdZddddZdS )	AES256r   r   r   r   r   c                 C  s   t | || _d S r   r   r   r   r   r   r   ?   s    zAES256.__init__Nr.   r   r   r   r   r/   9   s
   
r/   c                   @  sB   e Zd ZdZdZedddgZddddZed	d
ddZ	dS )CamelliaZcamelliar   r   r   r   r   c                 C  s   t | || _d S r   r   r   r   r   r   r   H   s    zCamellia.__init__r   r   c                 C  s   t | jd S r   r    r"   r   r   r   r#   K   s    zCamellia.key_sizeNr$   r   r   r   r   r0   C   s   r0   zARC4 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   )r(   zTripleDES 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                   @  sN   e Zd Zd ZedgZdddddZeddddZed	dd
dZ	dS )ChaCha20r   r   )r   noncec                 C  s6   t | || _td| t|dkr,td|| _d S )Nr2      z!nonce must be 128-bits (16 bytes))r
   r   r   Z_check_bytesliker!   
ValueError_nonce)r   r   r2   r   r   r   r   l   s
    zChaCha20.__init__r   c                 C  s   | j S r   )r5   r"   r   r   r   r2   u   s    zChaCha20.noncer   c                 C  s   t | jd S r   r    r"   r   r   r   r#   y   s    zChaCha20.key_sizeN)
r%   r&   r'   r(   r*   r+   r   r,   r2   r#   r   r   r   r   r1   h   s   
	r1   c                   @  s>   e Zd Zd ZdZedgZddddZedddd	Z	d
S )SM4r   bytesr   c                 C  s   t | || _d S r   r   r   r   r   r   r      s    zSM4.__init__r   r   c                 C  s   t | jd S r   r    r"   r   r   r   r#      s    zSM4.key_sizeNr$   r   r   r   r   r6   ~   s   
r6   N)Z
__future__r   Zcryptographyr   Z/cryptography.hazmat.decrepit.ciphers.algorithmsr   r   r   r   r   r	   Z/cryptography.hazmat.primitives._cipheralgorithmr
   Z&cryptography.hazmat.primitives.ciphersr   r   r   r-   r/   r0   Z
deprecatedr%   ZDeprecatedIn43r1   r6   r   r   r   r   <module>   s:   

