/
lib
/
python3
/
dist-packages
/
cryptography
/
hazmat
/
backends
/
openssl
/
__pycache__
/
Upload File
HOME
� p�g� � �z � d dl Z d dlmZmZmZ d dlmZ d dlmZ e j rd dlm Z d dlmZ G d� d� � Z dS ) � N)�InvalidSignature�UnsupportedAlgorithm�_Reasons)� constant_time)�CBC)�ciphers)�Backendc �X � e Zd Z d dd�Zdeddfd �Zdefd �Zdd�Zdeddfd �ZdS )�_CMACContextN�backendr � algorithm�ciphers.BlockCipherAlgorithm�returnc �H � |� |� � st dt j � � �|| _ |j | _ || _ |j dz | _ |��?| j j }|t |� � t f } || j |t � � }| j j � � � }| j � || j j j k � � | j j � || j j j � � }| j j � | j � � }| j j � ||t- | j � � || j j j � � }| j � |dk � � || _ d S )Nz#This backend does not support CMAC.� � )�cmac_algorithm_supportedr r �UNSUPPORTED_CIPHER�_backend�key�_key� _algorithm� block_size�_output_length�_cipher_registry�typer �_lib�CMAC_CTX_new�openssl_assert�_ffi�NULL�gc� CMAC_CTX_free�from_buffer� CMAC_Init�len�_ctx) �selfr r �ctx�registry�adapter� evp_cipher�key_ptr�ress �K/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/cmac.py�__init__z_CMACContext.__init__ sl � � �/�/� �:�:� �&�5��+�� � � �� ��M�� �#���'�2�a�7����;��}�5�H��t�I����3�4�G� ���� �3�?�?�J��-�$�1�1�3�3�C��M�(�(��� �0B�0G�)G�H�H�H��-�$�'�'��T�]�-?�-M�N�N�C��m�(�4�4�T�Y�?�?�G��-�$�.�.����D�I����� �"�'�� �C� �M�(�(����2�2�2��� � � � �datac � � | j j � | j |t |� � � � }| j � |dk � � d S )Nr )r r �CMAC_Updater'