-í Ż×>cs;dZd„ZeZdfd„ƒYZeed„ZdS(sxHMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. cs ditd„||ƒƒSdS(sKUtility method. XOR the two strings s1 and s2 (must have same length). scstt|ƒt|ƒAƒS(N(schrsordsxsy(sxsy((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pys sN(sjoinsmapss1ss2(ss1ss2((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pys_strxorssHMACcsAtZdZeed„Zd„Zd„Zd„Zd„ZRS(s_RFC2104 HMAC class. This supports the API for Cryptographic Hash Functions (PEP 247). cs |tjodk}|}n||_|iƒ|_|iƒ|_|i|_d}d|}d|}t |ƒ|jo|i|ƒi ƒ}n|tdƒ|t |ƒ}|iit||ƒƒ|iit||ƒƒ|tj 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. Ni@s6s\i(s digestmodsNonesmd5sselfsnewsoutersinners digest_sizes blocksizesipadsopadslenskeysdigestschrsupdates_strxorsmsg(sselfskeysmsgs digestmodsipads blocksizesopadsmd5((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pys__init__s$        cs|ii|ƒdS(s8Update this hashing object with the string msg. N(sselfsinnersupdatesmsg(sselfsmsg((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pysupdate5scsDtdƒ}|i|_|iiƒ|_|iiƒ|_|SdS(syReturn a separate copy of this hashing object. An update to this copy won't affect the original object. sN(sHMACsothersselfs digestmodsinnerscopysouter(sselfsother((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pyscopy:s   cs3|iiƒ}|i|iiƒƒ|iƒSdS(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. N(sselfsouterscopyshsupdatesinnersdigest(sselfsh((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pysdigestEscsWdigi}t|iƒƒD])}|tt|ƒƒdi dƒƒq ~ƒSdS(sKLike digest(), but returns a string of hexadecimal digits instead. siN( sjoinsappends_[1]stuplesselfsdigestsxshexsordszfill(sselfs_[1]sx((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pys hexdigestPs ( s__name__s __module__s__doc__sNones__init__supdatescopysdigests hexdigest(((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pysHMACs   cst|||ƒSdS(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. N(sHMACskeysmsgs digestmod(skeysmsgs digestmod((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pysnewVs N(s__doc__s_strxorsNones digest_sizesHMACsnew(s_strxorsnewsHMACs digest_size((s5/usr/pkg/lib/python2.2/site-packages/ZEO/auth/hmac.pys?s G