HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/cryptography/hazmat/primitives/ciphers/__pycache__/modes.cpython-38.pyc
U

�e�]��@s�ddlmZmZmZddlZddlZddlmZe�ej	�Gdd�de
��Ze�ej	�Gdd�de
��Ze�ej	�Gdd	�d	e
��Z
e�ej	�Gd
d�de
��Ze�ej	�Gdd
�d
e
��Zdd�Zdd�Zdd�Ze�e�e�e�Gdd�de
���Ze�e�e�e
�Gdd�de
���Ze�e�Gdd�de
��Ze�e�e�e�Gdd�de
���Ze�e�e�e�Gdd�de
���Ze�e�e�e�Gdd�de
���Ze�e�e�e�Gd d!�d!e
���Ze�e�e�e�e�e�Gd"d#�d#e
����ZdS)$�)�absolute_import�division�print_functionN)�utilsc@s(eZdZejdd��Zejdd��ZdS)�ModecCsdS)z@
        A string naming this mode (e.g. "ECB", "CBC").
        N���selfrr�N/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/ciphers/modes.py�namesz	Mode.namecCsdS)zq
        Checks that all the necessary invariants of this (mode, algorithm)
        combination are met.
        Nr�r	�	algorithmrrr
�validate_for_algorithmszMode.validate_for_algorithmN)�__name__�
__module__�__qualname__�abc�abstractpropertyr�abstractmethodrrrrr
rs
rc@seZdZejdd��ZdS)�ModeWithInitializationVectorcCsdS)zP
        The value of the initialization vector for this mode as bytes.
        Nrrrrr
�initialization_vector sz2ModeWithInitializationVector.initialization_vectorN)rrrrrrrrrr
rsrc@seZdZejdd��ZdS)�
ModeWithTweakcCsdS)z@
        The value of the tweak for this mode as bytes.
        Nrrrrr
�tweak)szModeWithTweak.tweakN)rrrrrrrrrr
r'src@seZdZejdd��ZdS)�
ModeWithNoncecCsdS)z@
        The value of the nonce for this mode as bytes.
        Nrrrrr
�nonce2szModeWithNonce.nonceN)rrrrrrrrrr
r0src@seZdZejdd��ZdS)�ModeWithAuthenticationTagcCsdS)zP
        The value of the tag supplied to the constructor of this mode.
        Nrrrrr
�tag;szModeWithAuthenticationTag.tagN)rrrrrrrrrr
r9srcCs |jdkr|jdkrtd��dS)N�ZAESz=Only 128, 192, and 256 bit keys are allowed for this AES mode)�key_sizer�
ValueErrorrrrr
�_check_aes_key_lengthBs�r cCs0t|j�d|jkr,td�t|j�|j���dS)N�zInvalid IV size ({}) for {}.)�lenr�
block_sizer�formatrrrrr
�_check_iv_lengthIs
�r%cCst||�t||�dS�N)r r%rrrr
�_check_iv_and_key_lengthPs
r'c@s&eZdZdZdd�Ze�d�ZeZ	dS)�CBCcCst�d|�||_dS�Nr�r�_check_byteslike�_initialization_vector�r	rrrr
�__init__ZszCBC.__init__r,N�
rrrrr.r�read_only_propertyrr'rrrrr
r(Us
r(c@s*eZdZdZdd�Ze�d�Zdd�ZdS)�XTScCs*t�d|�t|�dkr td��||_dS)Nr�z!tweak must be 128-bits (16 bytes))rr+r"r�_tweak)r	rrrr
r.gszXTS.__init__r3cCs|jdkrtd��dS)N)riz\The XTS specification requires a 256-bit key for AES-128-XTS and 512-bit key for AES-256-XTS)rrrrrr
rqs
�zXTS.validate_for_algorithmN)	rrrrr.rr0rrrrrr
r1bs
r1c@seZdZdZeZdS)�ECBN)rrrrr rrrrr
r4ysr4c@s&eZdZdZdd�Ze�d�ZeZ	dS)�OFBcCst�d|�||_dSr)r*r-rrr
r.�szOFB.__init__r,Nr/rrrr
r5�s
r5c@s&eZdZdZdd�Ze�d�ZeZ	dS)�CFBcCst�d|�||_dSr)r*r-rrr
r.�szCFB.__init__r,Nr/rrrr
r6�s
r6c@s&eZdZdZdd�Ze�d�ZeZ	dS)�CFB8cCst�d|�||_dSr)r*r-rrr
r.�sz
CFB8.__init__r,Nr/rrrr
r7�s
r7c@s*eZdZdZdd�Ze�d�Zdd�ZdS)�CTRcCst�d|�||_dS)Nr)rr+�_nonce)r	rrrr
r.�szCTR.__init__r9cCs:t||�t|j�d|jkr6td�t|j�|j���dS)Nr!zInvalid nonce size ({}) for {}.)r r"rr#rr$rrrrr
r�s
�zCTR.validate_for_algorithmN)	rrrrr.rr0rrrrrr
r8�s
r8c@s>eZdZdZdZdZddd�Ze�d�Z	e�d�Z
d	d
�ZdS)�GCMl��?lNr2cCstt�d|�t|�dkr td��||_|dk	rdt�d|�|dkrJtd��t|�|krdtd�|���||_||_dS)Nrrz-initialization_vector must be at least 1 byter�zmin_tag_length must be >= 4z.Authentication tag must be {} bytes or longer.)	rr+r"rr,�_check_bytesr$�_tagZ_min_tag_length)r	rrZmin_tag_lengthrrr
r.�s ��zGCM.__init__r=r,cCst||�dSr&)r rrrr
r�szGCM.validate_for_algorithm)Nr2)rrrrZ_MAX_ENCRYPTED_BYTESZ_MAX_AAD_BYTESr.rr0rrrrrrr
r:�s


r:)Z
__future__rrrrZsixZcryptographyrZ
add_metaclass�ABCMeta�objectrrrrrr r%r'Zregister_interfacer(r1r4r5r6r7r8r:rrrr
�<module>sP