Ñò
BwLc           @   sT   d  d k  Td  d k l Z d  d k Z d d d d e e e d „ Z e d „ Z d S(	   iÿÿÿÿ(   t   *(   t   _counterNt    i   i    c         C   sç   t  |  d ƒ \ } }	 |	 d j o t d |  f ƒ ‚ n | d j  o t d ƒ ‚ n | d j o t d ƒ ‚ n t | | | ƒ }
 | o, t i t | ƒ t | ƒ |
 d | d	 | ƒSt i t | ƒ t | ƒ |
 d | d	 | ƒSd  S(
   Ni   i    s%   nbits must be a multiple of 8; got %di   s   nbits too smalliÿÿ  s   nbits too larget   allow_wraparoundt   disable_shortcut(   t   divmodt
   ValueErrort   _encodeR   t   _newLEt   strt   _newBE(   t   nbitst   prefixt   suffixt   initial_valuet   overflowt   little_endianR   R   t   nbytest	   remaindert   initval(    (    sR   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Util\Counter.pyt   new   s    ,c         C   s|   g  } t  |  ƒ }  xZ t | ƒ D]L } | o | i t |  d @ƒ ƒ n | i d t |  d @ƒ ƒ |  d L}  q Wd i | ƒ S(   Niÿ   i    i   R   (   t   longt   ranget   appendt   chrt   insertt   join(   t   nR   R   t   retvalt   i(    (    sR   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Util\Counter.pyR   2   s     (   t   Crypto.Util.python_compatt   Crypto.UtilR   t   structt   FalseR   R   (    (    (    sR   C:\Documents and Settings\red08xgu\Desktop\python_webupdate\Crypto\Util\Counter.pyt   <module>   s   
