Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/Crypto/Hash/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyc

ó
T:´Nc@s^dZdZddgZddlmZddlTd
Zddd„ƒYZd
d
d	„Z	d
S(séHMAC (Keyed-Hashing for Message Authentication) Python module.

Implements the HMAC algorithm as described by RFC 2104.

This is just a copy of the Python 2.2 HMAC module, modified to work when
used on versions of Python before 2.2.
s$Id$tnewtdigest_sizeiÿÿÿÿ(tstrxor_c(t*tHMACcBsAeZdZddd„Zd„Zd„Zd„Zd„ZRS(s_RFC2104 HMAC class.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    cCsK|dkr!ddl}|}n||_|jƒ|_|jƒ|_y|j|_Wn)tk
rƒt|jj	ƒƒ|_nXy
|j
}Wntk
rªd}nXd}d}t|ƒ|krá|j|ƒj	ƒ}n|tdƒ|t|ƒ}|jjt
||ƒƒ|jjt
||ƒƒ|rG|j|ƒndS(sÝ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. Defaults to the md5 module.
        iÿÿÿÿNi@i6i\i(tNonetMD5t	digestmodRtoutertinnerRtAttributeErrortlentdigestt
block_sizetbchrtupdateR(tselftkeytmsgRRt	blocksizetipadtopad((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyt__init__;s.		



cCs|jj|ƒdS(s8Update this hashing object with the string msg.
        N(R	R(RR((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyRdscCsFttdƒƒ}|j|_|jjƒ|_|jjƒ|_|S(syReturn a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        t(RtbRR	tcopyR(Rtother((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyRis
cCs/|jjƒ}|j|jjƒƒ|jƒS(sö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.
        (RRRR	R(Rth((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyRtscCs6djgt|jƒƒD]}dt|ƒ^qƒS(sKLike digest(), but returns a string of hexadecimal digits instead.
        Rs%02x(tjointtupleRtbord(Rtx((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyt	hexdigests	N(	t__name__t
__module__t__doc__RRRRRR (((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyR5s)			cCst|||ƒS(sVCreate 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(RRR((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyR…sN((
R#t__revision__t__all__tCrypto.Util.strxorRtCrypto.Util.py3compatRRRR(((s4/usr/lib/python2.7/dist-packages/Crypto/Hash/HMAC.pyt<module>(s
P