%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/__pycache__/hmac.cpython-38.pyc

U

na@sdZddlZddlmZzddlZWnek
r@dZdZ	YnXe
ejZ	ddlZe
ddedDZe
ddedDZdZGdd	d	ZdddZd
dZdS)zqHMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
N)_compare_digestccs|]}|dAVqdS)\N.0xrr /usr/local/lib/python3.8/hmac.py	<genexpr>sr	ccs|]}|dAVqdS)6Nrrrrrr	sc@sReZdZdZdZdddZeddZd	d
ZddZ	d
dZ
ddZddZdS)HMACz~RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    @NcsFt|ttfs tdt|js,tdtr<|_n,ttrXdfdd	|_ndfdd	|_||_	||_
|j
j|_t|j
dr|j
j
}|dkrtd	||jftd
|j}ntd|jtd
|j}||_
t||kr||}||d}|j	|t|j
|t|d
k	rB||d
S)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 parameter 'digestmod'.cst|SN_hashlibnewd	digestmodrr<lambda>8rzHMAC.__init__.<locals>.<lambda>cs
|Srrrrrrr:r
block_sizez:block_size of %d seems too small; using our default of %d.z<No block_size attribute on given digest object; Assuming %d.N)r)r)
isinstancebytes	bytearray	TypeErrortype__name__callabledigest_consstrouterinnerdigest_sizehasattrr	_warningswarn	blocksizeRuntimeWarninglendigestljustupdate	translatetrans_5Ctrans_36)selfkeymsgrr-rrr__init__!sJ




z
HMAC.__init__cCsd|jjS)Nzhmac-)r(name)r6rrrr:Zsz	HMAC.namecCs|j|dS)z,Feed data from msg into this hashing object.N)r(r2)r6r8rrrr2^szHMAC.updatecCs:|j|j}|j|_|j|_|j|_|j|_|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')r6otherrrrr=bsz	HMAC.copycCs|j}||j|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )r'r=r2r(r0r6hrrr_currentos
z
HMAC._currentcCs|}|S)zReturn the hash value of this hashing object.

        This returns the hmac value as bytes.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        )rAr0r?rrrr0xszHMAC.digestcCs|}|S)zKLike digest(), but returns a string of hexadecimal digits instead.
        )rA	hexdigestr?rrrrBszHMAC.hexdigest)Nr)
r#
__module____qualname____doc__r-r9propertyr:r2r=rAr0rBrrrrrs
9

	
rrcCst|||S)aCreate a new hashing object and return it.

    key: bytes or buffer, The starting key for the hash.
    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.

    You can now feed arbitrary bytes into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    or hexdigest() methods.
    )r)r7r8rrrrrsrcstdk	r(ttr(tkr(t||Str6}n(ttrPd	fdd	}nd
fdd	}|}|}t|dd}t||kr||}|d|t|}|	|
t|	|
t|	||	||S)aJFast inline implementation of HMAC.

    key: bytes or buffer, The key for the keyed hash object.
    msg: bytes or buffer, 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.
    Nrcst|Srrrr0rrrrzdigest.<locals>.<lambda>cs
|SrrrrGrrrrrr
r)r)r)
_hashopensslrr&_openssl_md_methsZhmac_digestr$getattrr/r0r2r3r5r4)r7r8r0r%r(r'r-rrGrr0s,	

r0)Nr)rEwarningsr+	_operatorrZcompare_digestrrHImportErrorrI	frozensetZopenssl_md_meth_namesZhashlibrranger4r5r)rrr0rrrr<module>s

n


Zerion Mini Shell 1.0