3
�L�j� � @ s� d Z ddlZddlmZ ddlZddlZddl Z e
dd� ed�D ��Ze
dd� ed�D ��Z
dZG dd � d �Zd
d� ZG dd
� d
e j�Zej� r�eZddd�ZdS )zxHMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
� N)�_compare_digestc c s | ]}|d A V qdS )�\ N� )�.0�xr r �/usr/lib64/python3.6/hmac.py� s r � c c s | ]}|d A V qdS )�6 Nr )r r r r r r
s c @ sR e Zd ZdZdZddd�Zedd� �Zdd � Zd
d� Z dd
� Z
dd� Zdd� ZdS )�HMACz~RFC 2104 HMAC class. Also complies with RFC 4231.
This supports the API for Cryptographic Hash Functions (PEP 247).
�@ Nc sf t j� rtd��t|ttf�s0tdt|�j ��� dkrLt j
dtd� tj
� t� �r\� | _n,t� t�rxd� fdd � | _nd� fd
d � | _| j� | _| j� | _| jj| _t| jd�r�| jj}|dk r�t j
d
|| jf td� | j}nt j
d| j td� | j}|| _t|�|k�r| j|�j� }|j|d�}| jj|jt�� | jj|jt�� |dk �rb| j|� dS )a1 Create a new HMAC object.
key: key for the keyed hash object.
msg: Initial input for the hash, if provided.
digestmod: A module supporting PEP 247. *OR*
A hashlib constructor returning a new hash object. *OR*
A hash name suitable for hashlib.new().
Defaults to hashlib.md5.
Implicit default to hashlib.md5 is deprecated and will be
removed in Python 3.6.
Note: key and msg must be a bytes or bytearray objects.
z*This class is not available in FIPS mode. zUse hmac.new().z,key: expected bytes or bytearray, but got %rNz