ó
Bd\Rc           @   sŹ   d  Z  d Z d d d g Z d d l Td d l m Z y d d l Z e j Z Wn# e	 k
 rs d d l
 Z
 e
 Z n Xd e f d	     YZ d d
  Z e j Z e j Z d S(   s  SHA-1 cryptographic hash algorithm.

SHA-1_ produces the 160 bit digest of a message.

    >>> from Crypto.Hash import SHA
    >>>
    >>> h = SHA.new()
    >>> h.update(b'Hello')
    >>> print h.hexdigest()

*SHA* stands for Secure Hash Algorithm.

This algorithm is not considered secure. Do not use it for new designs.

.. _SHA-1: http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
s   $Id$t   newt   digest_sizet   SHA1Hashi˙˙˙˙(   t   *(   t   HashAlgoNc           B   s>   e  Z d  Z e d  Z d Z d Z d d  Z d d  Z	 RS(   sJ   Class that implements a SHA-1 hash
    
    :undocumented: block_size
    s   +i   i@   c         C   s   t  j |  t |  d  S(   N(   R   t   __init__t   hashFactory(   t   selft   data(    (    s.   lib/python2.7/site-packages/Crypto/Hash/SHA.pyR   I   s    c         C   s
   t  |  S(   N(   R   (   R   R   (    (    s.   lib/python2.7/site-packages/Crypto/Hash/SHA.pyR    L   s    N(
   t   __name__t
   __module__t   __doc__t   bt   oidR   t
   block_sizet   NoneR   R    (    (    (    s.   lib/python2.7/site-packages/Crypto/Hash/SHA.pyR   6   s   
c         C   s   t    j |   S(   s  Return a fresh instance of the hash object.

    :Parameters:
       data : byte string
        The very first chunk of the message to hash.
        It is equivalent to an early call to `SHA1Hash.update()`.
        Optional.

    :Return: A `SHA1Hash` object
    (   R   R    (   R   (    (    s.   lib/python2.7/site-packages/Crypto/Hash/SHA.pyR    O   s    (   R   t   _revision__t   __all__t   Crypto.Util.py3compatt   Crypto.Hash.hashalgoR   t   hashlibt   sha1R   t   ImportErrort   shaR   R   R    R   R   (    (    (    s.   lib/python2.7/site-packages/Crypto/Hash/SHA.pyt   <module>$   s   

	