/
lib
/
python3
/
dist-packages
/
cryptography
/
hazmat
/
backends
/
openssl
/
__pycache__
/
Upload File
HOME
� p�g � �r � d dl Z d dlmZmZmZ d dlmZmZ e j rd dl m Z G d� dej � � ZdS )� N)�InvalidSignature�UnsupportedAlgorithm�_Reasons)� constant_time�hashes)�Backendc � � e Zd Z ddddedej fd�Zedej fd�� � Zdd �Z d eddfd�Z defd�Zd eddfd�ZdS )�_HMACContextN�backendr �key� algorithmc �� � || _ || _ |��W| j j � � � }| j � || j j j k � � | j j � || j j j � � }| j � |� � }|| j j j k r2t d� |j � � t j � � �| j j � |� � }| j j � ||t# |� � || j j j � � }| j � |dk � � || _ || _ d S )Nz*{} is not a supported hash on this backendr )� _algorithm�_backend�_lib�HMAC_CTX_new�openssl_assert�_ffi�NULL�gc� HMAC_CTX_free�_evp_md_from_algorithmr �format�namer �UNSUPPORTED_HASH�from_buffer�HMAC_Init_ex�len�_ctx�_key)�selfr r r �ctx�evp_md�key_ptr�ress �K/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/hmac.py�__init__z_HMACContext.__init__ sG � � $����� ��;��-�$�1�1�3�3�C��M�(�(��� �0B�0G�)G�H�H�H��-�$�'�'��T�]�-?�-M�N�N�C��]�9�9�)�D�D�F����+�0�0�0�*�@�G�G�!��� � �-� � � � �m�(�4�4�S�9�9�G��-�$�1�1��W�c�#�h�h��� �0B�0G�� �C� �M�(�(����2�2�2��� ��� � � � �returnc � � | j S �N)r )r! s r&