File: //lib/python3/dist-packages/cryptography/hazmat/primitives/ciphers/__pycache__/modes.cpython-38.pyc
U
�)%a� � @ sH d dl Z d dlZd dlmZ d dlmZ G dd� de jd�ZG dd� de jd�ZG d d
� d
e jd�Z G dd� de jd�Z
G d
d� de jd�Zdd� Zdd� Z
eed�dd�Zdd� ZG dd� dee�ZG dd� dee �ZG dd� de�ZG dd� dee�ZG d d!� d!ee�ZG d"d#� d#ee�ZG d$d%� d%ee
�ZG d&d'� d'eee�ZdS )(� N)�utils)�CipherAlgorithmc @ s6 e Zd Zejed�dd��Zejedd�dd��Z dS )�Mode��returnc C s dS )z@
A string naming this mode (e.g. "ECB", "CBC").
N� ��selfr r �N/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/ciphers/modes.py�name s z Mode.nameN)� algorithmr c C s dS )zq
Checks that all the necessary invariants of this (mode, algorithm)
combination are met.
Nr �r r r r r
�validate_for_algorithm s zMode.validate_for_algorithm)
�__name__�
__module__�__qualname__�abc�abstractproperty�strr �abstractmethodr r r r r r
r
s r )� metaclassc @ s e Zd Zejed�dd��ZdS )�ModeWithInitializationVectorr c C s dS )zP
The value of the initialization vector for this mode as bytes.
Nr r r r r
�initialization_vector s z2ModeWithInitializationVector.initialization_vectorN)r r r r r �bytesr r r r r
r s r c @ s e Zd Zejed�dd��ZdS )�
ModeWithTweakr c C s dS )z@
The value of the tweak for this mode as bytes.
Nr r r r r
�tweak% s zModeWithTweak.tweakN)r r r r r r r r r r r
r $ s r c @ s e Zd Zejed�dd��ZdS )�
ModeWithNoncer c C s dS )z@
The value of the nonce for this mode as bytes.
Nr r r r r
�nonce- s zModeWithNonce.nonceN)r r r r r r r r r r r
r , s r c @ s e Zd Zejed�dd��ZdS )�ModeWithAuthenticationTagr c C s dS )zP
The value of the tag supplied to the constructor of this mode.
Nr r r r r
�tag5 s zModeWithAuthenticationTag.tagN)r r r r r r r r r r r
r 4 s r c C s |j dkr|jdkrtd��d S )N� �AESz=Only 128, 192, and 256 bit keys are allowed for this AES mode)�key_sizer �
ValueErrorr
r r r
�_check_aes_key_length<