-í
çĥ<c       sD   d  Z  d k Z d   Z e Z d f  d     YZ e e d  Z d S(   sx   HMAC (Keyed-Hashing for Message Authentication) Python module.

Implements the HMAC algorithm as described by RFC 2104.
Nc    s    d i  t d   |  |   Sd S(   sK   Utility method. XOR the two strings s1 and s2 (must have same length).
    s    c    s   t  t |   t |  A S(   N(   s   chrs   ords   xs   y(   s   xs   y(    (    s   /usr/lib/python2.2/hmac.pys   <lambda> s    N(   s   joins   maps   s1s   s2(   s   s1s   s2(    (    s   /usr/lib/python2.2/hmac.pys   _strxor s     s   HMACc      sA   t  Z d  Z e e d  Z d   Z d   Z d   Z d   Z RS(   s_   RFC2104 HMAC class.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    c    s  | t j o d k } | } n | |  _  | i   |  _ | i   |  _ | i |  _ d } d | } d | } t |  | j o | i |  i   } n | t d  | t |  } |  i i t | |   |  i i t | |   | o |  i |  n d S(   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@   s   6s   \i    (   s	   digestmods   Nones   md5s   selfs   news   outers   inners   digest_sizes	   blocksizes   ipads   opads   lens   keys   digests   chrs   updates   _strxors   msg(   s   selfs   keys   msgs	   digestmods   ipads	   blocksizes   opads   md5(    (    s   /usr/lib/python2.2/hmac.pys   __init__ s$     	
	

c    s   |  i i |  d S(   s8   Update this hashing object with the string msg.
        N(   s   selfs   inners   updates   msg(   s   selfs   msg(    (    s   /usr/lib/python2.2/hmac.pys   update7 s     c    sD   t  d  } |  i | _ |  i i   | _ |  i i   | _ | Sd S(   sy   Return a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        s    N(   s   HMACs   others   selfs	   digestmods   inners   copys   outer(   s   selfs   other(    (    s   /usr/lib/python2.2/hmac.pys   copy< s     c    s3   |  i i   } | i |  i i    | i   Sd 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.
        N(   s   selfs   outers   copys   hs   updates   inners   digest(   s   selfs   h(    (    s   /usr/lib/python2.2/hmac.pys   digestG s     c    sZ   d i  g  i } t |  i    D], } | t i t	 t
 |   d d   q  ~  Sd S(   sK   Like digest(), but returns a string of hexadecimal digits instead.
        s    i   N(   s   joins   appends   _[1]s   tuples   selfs   digests   xs   strings   zfills   hexs   ord(   s   selfs   _[1]s   x(    (    s   /usr/lib/python2.2/hmac.pys	   hexdigestR s      (	   s   __name__s
   __module__s   __doc__s   Nones   __init__s   updates   copys   digests	   hexdigest(    (    (    s   /usr/lib/python2.2/hmac.pys   HMAC s     			c    s   t  |  | |  Sd S(   sV  Create 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(   s   HMACs   keys   msgs	   digestmod(   s   keys   msgs	   digestmod(    (    s   /usr/lib/python2.2/hmac.pys   newX s    
 (   s   __doc__s   strings   _strxors   Nones   digest_sizes   HMACs   new(   s   strings   _strxors   news   HMACs   digest_size(    (    s   /usr/lib/python2.2/hmac.pys   ? s
   		G