Ñò µ!ÝLc@sMdZdZddkZd„ZdZddd„ƒYZddd„ZdS( 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. s0$Id: HMAC.py,v 1.5 2002/07/25 17:19:02 z3p Exp $iÿÿÿÿNcCsditd„||ƒƒS(sKUtility method. XOR the two strings s1 and s2 (must have same length). tcSstt|ƒt|ƒAƒS((tchrtord(txty((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyts(tjointmap(ts1ts2((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyt_strxor stHMACcBsAeZdZddd„Zd„Zd„Zd„Zd„ZRS(s_RFC2104 HMAC class. This supports the API for Cryptographic Hash Functions (PEP 247). c Cs:|djoddk}|}n||_|iƒ|_|iƒ|_y|i|_Wn+tj ot|ii ƒƒ|_nXd}d|}d|}t|ƒ|jo|i|ƒi ƒ}n|t dƒ|t|ƒ}|ii t ||ƒƒ|ii t ||ƒƒ|o|i |ƒ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@t6s\i( tNonetMD5t digestmodtnewtoutertinnert digest_sizetAttributeErrortlentdigestRtupdateR (tselftkeytmsgRRt blocksizetipadtopad((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyt__init__s(      cCs|ii|ƒdS(s8Update this hashing object with the string msg. N(RR(RR((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyR?scCs@tdƒ}|i|_|iiƒ|_|iiƒ|_|S(syReturn a separate copy of this hashing object. An update to this copy won't affect the original object. R(R RRtcopyR(Rtother((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyRDs   cCs/|iiƒ}|i|iiƒƒ|iƒ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. (RRRRR(Rth((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyROscCsPdig}t|iƒƒD])}|titt|ƒƒddƒq~ƒS(sKLike digest(), but returns a string of hexadecimal digits instead. Ri(RttupleRtstringtzfillthexR(Rt_[1]R((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyt hexdigestZs N( t__name__t __module__t__doc__R RRRRR'(((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyR s #  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((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyR`s ((R*t __revision__R#R R RR R(((s6/usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyts   J