eaiovnaovbqoebvqoeavibavo B  fu@sdZddlZddlmZy ddlZWnek r@dZdZ Yn Xe ej Z ddl Ze ddedDZe ddedDZdZGdd d Zdd d Zd d ZdS)zxHMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. N)_compare_digestccs|]}|dAVqdS)\N).0xrr)/opt/alt/python37/lib64/python3.7/hmac.py srccs|]}|dAVqdS)6Nr)rrrrrrsc@sReZdZdZdZdddZeddZdd Zd d Z d d Z ddZ ddZ dS)HMACz~RFC 2104 HMAC class. Also complies with RFC 4231. This supports the API for Cryptographic Hash Functions (PEP 247). @NcsVt|ttfs tdt|jdkr=rzHMAC.__init__..cs |S)N)r)r)rrrr?r block_sizez:block_size of %d seems too small; using our default of %d.z    r cCs t|||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 )r1r2rrrrrs rcstdk r(ttr(tkr(t||Str6}n(ttrPd fdd }nd fdd }|}|}t|dd}t||kr||}|d|t|}| | t | | t | || ||S) aeFast inline implementation of HMAC key: key for the keyed hash object. msg: input message digest: A hash name suitable for hashlib.new() for best performance. *OR* A hashlib constructor returning a new hash object. *OR* A module supporting PEP 247. Note: key and msg must be a bytes or bytearray objects. Nrcs t|S)N)rr)r)r*rrrrzdigest..cs |S)N)r)r)r*rrrrrr r)r)r) _hashopensslrr"_openssl_md_methsZ hmac_digestr getattrr)r*r,r-r/r.)r1r2r*r!r$r#r'r)r*rr*s&      r*)NN)r>warningsr _operatorrZcompare_digestrr@ ImportErrorrA frozensetZopenssl_md_meth_namesZhashlibrranger.r/r%r rr*rrrrs    t