/
lib
/
python3
/
dist-packages
/
cryptography
/
hazmat
/
primitives
/
kdf
/
__pycache__
/
Upload File
HOME
� p�g�# � � � d dl Z d dlmZ d dlmZmZmZmZ d dlm Z m Z mZmZm Z d dlmZ G d� dej � � Z G d� d ej � � Z G d � d� � Z G d� d e� � Z G d� de� � ZdS )� N)�utils)�AlreadyFinalized� InvalidKey�UnsupportedAlgorithm�_Reasons)�ciphers�cmac� constant_time�hashes�hmac)�KeyDerivationFunctionc � � e Zd ZdZdS )�Mode�ctrN)�__name__� __module__�__qualname__�CounterMode� � �J/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyr r s � � � � � ��K�K�Kr r c � � e Zd ZdZdZdZdS )�CounterLocation�before_fixed�after_fixed�middle_fixedN)r r r �BeforeFixed� AfterFixed�MiddleFixedr r r r r s � � � � � � �K��J� �K�K�Kr r c � � e Zd Zdej dedededej e dedej e dej e d ej e d ej e fd�Z eded efd�� � Z de ded e fd�Zd e fd�ZdS )� _KBKDFDeriver�prf�mode�length�rlen�llen�location�break_location�label�context�fixedc � � t |� � sJ �t |t � � st d� � �t |t � � st d� � �|�|t j u rt d� � �|�|t j k rt d� � �|�$t |t � � st d� � �|�|dk rt d� � �|s| r| rt d� � �|�| � |� � st d � � �|�| �t d � � �|�$t |t � � st d� � �|�d}| �d} t j d |� � t j d| � � || _ || _ || _ || _ || _ || _ || _ || _ | | _ d| _ | | _ d S )Nzmode must be of type Modez(location must be of type CounterLocationzPlease specify a break_locationzJbreak_location is ignored when location is not CounterLocation.MiddleFixedz!break_location must be an integerr z)break_location must be a positive integerz9When supplying fixed data, label and context are ignored.zrlen must be between 1 and 4zPlease specify an llenzllen must be an integerr r) r* F)�callable� isinstancer � TypeErrorr r � ValueError�int�_valid_byte_lengthr �_check_bytes�_prf�_mode�_length�_rlen�_llen� _location�_break_location�_label�_context�_used�_fixed_data)�selfr"