AlkantarClanX12

Your IP : 3.138.32.53


Current Path : /opt/alt/python34/lib64/python3.4/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/__pycache__/hmac.cpython-34.pyc

�
f f��@s�dZddlZddlmZddlZedd�e	d�D��Z
edd�e	d�D��ZdZGdd	�d	�Z
ddd
d�ZdS)zxHMAC (Keyed-Hashing for Message Authentication) Python module.

Implements the HMAC algorithm as described by RFC 2104.
�N)�_compare_digestccs|]}|dAVqdS)�\N�)�.0�xrr�)/opt/alt/python34/lib64/python3.4/hmac.py�	<genexpr>
sr�ccs|]}|dAVqdS)�6Nr)rrrrrrsc@s|eZdZdZdZdddd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�HMACz~RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    �@Ncs�t|ttf�s1tdt|�j��n�dkr\tjdtd�t	j
�nt��rt�|_nBt�t
�r�d�fdd�|_nd�fdd�|_|j�|_|j�|_|jj|_t|jd	�r<|jj}|d
kr_tjd||jftd�|j}q_n#tjd|jtd�|j}||_t|�|kr�|j|�j�}n|t|t|��}|jj|jt��|jj|jt��|dk	r�|j|�ndS)
a1Create 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,key: expected bytes or bytearray, but got %rNz<HMAC() without an explicit digestmod argument is deprecated.��cstj�|�S)N)�_hashlib�new)�d)�	digestmodrr�<lambda>4szHMAC.__init__.<locals>.<lambda>cs
�j|�S)N)r)r)rrrr6s�
block_size�z:block_size of %d seems too small; using our default of %d.z<No block_size attribute on given digest object; Assuming %d.)�
isinstance�bytes�	bytearray�	TypeError�type�__name__�	_warnings�warn�PendingDeprecationWarningrZmd5�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	blocksize�RuntimeWarning�len�digest�update�	translate�trans_5C�trans_36)�self�key�msgrr&r)rr�__init__sB	
	

	
		z
HMAC.__init__cCsd|jjS)Nzhmac-)r#�name)r.rrrr2Vsz	HMAC.namecCs|jj|�dS)z8Update this hashing object with the string msg.
        N)r#r*)r.r0rrrr*ZszHMAC.updatecCsU|jj|j�}|j|_|j|_|jj�|_|jj�|_|S)zyReturn a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        )�	__class__�__new__r r$r#�copyr")r.�otherrrrr5_sz	HMAC.copycCs)|jj�}|j|jj��|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )r"r5r*r#r))r.�hrrr�_currentlsz
HMAC._currentcCs|j�}|j�S)z�Return the hash value of this hashing object.

        This returns a string containing 8-bit data.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        )r8r))r.r7rrrr)uszHMAC.digestcCs|j�}|j�S)zKLike digest(), but returns a string of hexadecimal digits instead.
        )r8�	hexdigest)r.r7rrrr9szHMAC.hexdigest)
r�
__module__�__qualname__�__doc__r&r1�propertyr2r*r5r8r)r9rrrrrs<
	
rcCst|||�S)aVCreate a new hashing object and return it.

    key: The starting key for the hash.
    msg: if available, will immediately be hashed into the object's starting
    state.

    You can now feed arbitrary strings into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    method.
    )r)r/r0rrrrr�sr)r<�warningsr�	_operatorrZcompare_digestZhashlibrr�ranger,r-r$rrrrrr�<module>sr