File: //usr/lib/python3.5/__pycache__/hmac.cpython-35.pyc
FüƒaÇ ã @ s› d Z d d l Z d d l m Z d d l Z e d d „ e d ƒ Dƒ ƒ Z
e d d „ e d ƒ Dƒ ƒ Z d Z Gd d „ d ƒ Z
d d d
d „ Z d S)zxHMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
é N)Ú_compare_digestc c s | ] } | d AVq d S)é\ N© )Ú.0Úxr r ú/usr/lib/python3.5/hmac.pyú <genexpr>
s r é c c s | ] } | d AVq d S)é6 Nr )r r r r r r s c @ s| e Z d Z d Z d Z d d d d „ Z e d d „ ƒ Z d d „ Z d
d „ Z d d
„ Z
d d „ Z d d „ Z d S)ÚHMACz~RFC 2104 HMAC class. Also complies with RFC 4231.
This supports the API for Cryptographic Hash Functions (PEP 247).
é@ Nc sï t | t t f ƒ s. t d t | ƒ j ƒ ‚ ˆ d k rV t j d t d ƒ t j
‰ t ˆ ƒ rn ˆ | _ nB t ˆ t
ƒ r˜ d ‡ f d d † | _ n d ‡ f d d † | _ | j ƒ | _ | j ƒ | _ | j j | _ t | j d ƒ r3| j j } | d
k rVt j d | | j f t d ƒ | j } n# t j d | j t d ƒ | j } | | _ t | ƒ | k r†| j | ƒ j ƒ } | t | t | ƒ ƒ } | j j | j t ƒ ƒ | j j | j t ƒ ƒ | d k rë| j | ƒ d S)
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,key: expected bytes or bytearray, but got %rNz<HMAC() without an explicit digestmod argument is deprecated.é ó c s t j ˆ | ƒ S)N)Ú_hashlibÚnew)Úd)Ú digestmodr r Ú<lambda>4 s zHMAC.__init__.<locals>.<lambda>c s
ˆ j | ƒ S)N)r )r )r r r r 6 s Ú
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ÚPendingDeprecationWarningr Zmd5ÚcallableÚdigest_consÚstrÚouterÚinnerÚdigest_sizeÚhasattrr Ú blocksizeÚRuntimeWarningÚlenÚdigestÚupdateÚ translateÚtrans_5CÚtrans_36)ÚselfÚkeyÚmsgr r&