� !A?h$��"�dZddlZ ddlZejZeej��Zn#e $r dZdZddl m ZYnwxYwddl Ze d�ed��D����Ze d�ed��D����ZdZGd�d��Zd d �Zd �ZdS) zqHMAC (Keyed-Hashing for Message Authentication) module. Implements the HMAC algorithm as described by RFC 2104. �N)�_compare_digestc#� K�|] }|dz V�� dS)�\N���.0�xs �1/opt/alt/python-internal/lib64/python3.11/hmac.py� r �&����0�0��!�d�(�0�0�0�0�0�0��c#� K�|] }|dz V�� dS)�6Nrrs r r r r r c�b�eZdZdZdZdZdd�Zd�Zd�Ze d ���Z d �Z d �Z d �Z d �Zd�ZdS)�HMACz~RFC 2104 HMAC class. Also complies with RFC 4231. This supports the API for Cryptographic Hash Functions (PEP 247). �@)�_hmac�_inner�_outer� block_size� digest_sizeN�c��t|ttf��s$tdt |��jz���|std���t rct|ttf��rG |� |||��dS#t j $r|� |||��YdSwxYw|� |||��dS)a?Create a new HMAC object. key: bytes or buffer, key for the keyed hash object. msg: bytes or buffer, Initial input for the hash or None. digestmod: A hash name suitable for hashlib.new(). *OR* A hashlib constructor returning a new hash object. *OR* A module supporting PEP 247. Required as of 3.8, despite its position after the optional msg argument. Passing it as a keyword argument is recommended, though not required for legacy API reasons. z,key: expected bytes or bytearray, but got %rz&Missing required argument 'digestmod'.N) � isinstance�bytes� bytearray� TypeError�type�__name__� _hashopenssl�str� _functype� _init_hmac�UnsupportedDigestmodError� _init_old��self�key�msg� digestmods r �__init__z HMAC.__init__&s����#��y�1�2�2� a��J�T�RU�Y�Y�M_�_�`�`� `�� F��D�E�E� E� � 0�J�y�3� �2B�C�C� 0� 4�����S�)�4�4�4�4�4���9� 4� 4� 4����s�C��3�3�3�3�3�3� 4���� �N�N�3��Y� /� /� /� /� /s�6B�&B9�8B9c��tj|||���|_|jj|_|jj|_dS)N)r+)r!�hmac_newrrrr's r r$zHMAC._init_hmacBs8��!�*�3��y�I�I�I�� ��:�1����*�/����r c�l��t���r�}n"t�t��rd �fd� }nd �fd� }d|_|��|_|��|_|jj|_t|jd��r?|jj}|dkr,tj d||j fztd��|j }n*tj d|j ztd��|j }t|��|kr||�����}||_|�|d ��}|j�|�t$����|j�|�t&����|�|�|��dSdS) Nr c�.��tj�|��S�N��_hashlib�new��dr+s �r �z HMAC._init_old..Ks���� �Y��(B�(B�r c�.����|��Sr1�r4r5s �r r7z HMAC._init_old..Ms��� � � �a�(8�(8�r r�z:block_size of %d seems too small; using our default of %d.�z.�s���H�L���$;�$;�r c�.����|��Sr1r9res �r r7zdigest..�s���F�J�J�q�M�M�r rrr<r=)r!rr"r#� hmac_digestr%r>�getattrrDrErGrHrJrI)r)r*rErK�inner�outerrBs ` r rErE�s������J�v��Y�7G�$H�$H�� ��+�C��f�=�=� =���5� � � � �D� ��������2�� � � �F�C� � �2�;�;�;�;�;� � �1�1�1�1�1� � �K�M�M�E� �K�M�M�E���|�R�0�0�I� �3�x�x�)����k�#���%�%�'�'�� ��9�s�3�x�x�/�0� 0�C� �L�L����x�(�(�)�)�)� �L�L����x�(�(�)�)�)� �L�L����� �L�L������ � � � �<�<�>�>�s�<�A� Ar\)r_�warningsr@r3r!�compare_digestr�openssl_sha256r#� ImportError� _operatorr�hashlibr�rangerIrJrrr4rErr r �rrsJ���� ����2�#�#�#�#� "�0�N���\�0�1�1�I�I�� �<�<�<��L��I�;�;�;�;�;�;�;�;�<�������� �5�0�0�U�U�3�Z�Z�0�0�0� 0� 0�� �5�0�0�U�U�3�Z�Z�0�0�0� 0� 0��� �J�J�J�J�J�J�J�J�X%�%�%�%�( � � � � s �$�6�6