� b-�Qc @ s� d Z d Z d Z d d l Z d d l Z d d � Z d � Z d � Z d � Z d � Z d � Z d � Z e e e e g Z d d d d g Z d d d � � YZ d Z d Z d Z d d � Z e d k r� d Z e e � Z e j e � n d S( s� A sample implementation of SHA-1 in pure Python. Framework adapted from Dinu Gherman's MD5 implementation by J. Hallén and L. Creighton. SHA-1 implementation based directly on the text of the NIST standard FIPS PUB 180-1. s 2004-11-17g��Q��?i����Ni c C s� d } t j } x1 | d k rB | d | d @� | } | d ?} q Wx: t t | � � D] } | | d k rV PqV qV Wd } d } | | } | d k r� t | � | r� | t | � | d | } n | S( s� Convert a long integer to a byte string. If optional blocksize is given and greater than zero, pad the front of the byte string with binary zeros so that the length is a multiple of blocksize. t i s >Il �� i t ( t structt packt ranget len( t nt blocksizet sR t i( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt _long2bytesBigEndian s c C s� t | � d } d g | } d } d } x� | | k r� t | | � d >} t | | d � d >} t | | d � d >} t | | d � } | | B| B| B| | <| d } | d } q, W| S( s4 Transform a list of characters into a list of longs.i i i i i i i i ( R t ord( t listt imaxt hlt jR t b0t b1t b2t b3( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt _bytelist2longBigEndian: s c C s | | >| d | ?BS( s) Rotate x (32 bit) left n bits circularly.i ( ( t xR ( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt _rotateLeftN s c C s | | @| | @BS( N( ( t Bt Ct D( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt f0_19Y s c C s | | A| AS( N( ( R R R ( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt f20_39\ s c C s | | @| | @B| | @BS( N( ( R R R ( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt f40_59_ s c C s | | A| AS( N( ( R R R ( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt f60_79b s i�y�Zi���nl �<7 l �A� t shac B s] e Z d Z d Z Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( s: An implementation of the MD5 hash function in pure Python.i i c C s/ d | _ d d g | _ g | _ | j � d S( s Initialisation.i N( t lengtht countt inputt init( t self( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyt __init__v s c C sC d | _ g | _ d | _ d | _ d | _ d | _ d | _ d S( s9 Initialize the message-digest and set all fields to zero.i i#Egl �+�_ l �\u1 ivT2l �a� N( R R! t H0t H1t H2t H3t H4( R# ( ( sE /usr/lib/python2.7/site-packages/setuptools/_backport/hashlib/_sha.pyR"