ó
‹wÛjc           @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z y d  d l Z Wn e k
 rY e Z n Xd  d l Z d  d l Z d  d l	 m
 Z
 d  d l m Z d  d l m Z m Z e e d ƒ Z d „  Z d e j f d „  ƒ  YZ d	 e j f d
 „  ƒ  YZ d „  Z e d k re ƒ  n  d S(   iÿÿÿÿN(   t	   unhexlify(   t   test_support(   t   _4Gt   precisionbigmemtestt   gettotalrefcountc         C   s^   d d  l  } | j } d } x< |  D]4 } t | ƒ } | | | d ?d @| | d @} q" W| S(   Niÿÿÿÿt    i   i   (   t   stringt	   hexdigitst   ord(   t   sR   t   ht   rt   ct   i(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   hexstr   s    	&t   HashLibTestCasec           B   sž  e  Z d> Z e Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e j e j e d k  d ƒ e d e d d  d! d" e ƒ d# „  ƒ ƒ Z e j e j e d k  d ƒ e d e d d  d! d" e ƒ d$ „  ƒ ƒ Z e j e j e d! k  d ƒ e d e d! d  d! d" e ƒ d% „  ƒ ƒ Z d& „  Z  d' „  Z! d( „  Z" d) „  Z# e d e d d  d! ƒ d* „  ƒ Z$ e d e d d  d! ƒ d+ „  ƒ Z% d, „  Z& d- „  Z' d. „  Z( d/ „  Z) d0 „  Z* d1 „  Z+ d2 „  Z, d3 „  Z- d4 „  Z. d5 „  Z/ d6 „  Z0 d7 „  Z1 d8 „  Z2 d9 „  Z3 d: „  Z4 d; „  Z5 e j6 e7 d< ƒ e8 j9 d= „  ƒ ƒ Z: RS(?   t   md5t   MD5t   sha1t   SHA1t   sha224t   SHA224t   sha256t   SHA256t   sha384t   SHA384t   sha512t   SHA512c         B   sS   y d | d UWn0 e  k
 rB } |  j rC e j d | ƒ qC n Xe ƒ  j | ƒ S(   s@   Import a module and return a reference to it or None on failure.s   import Ns%   Did a C extension fail to compile? %s(   t   ImportErrort   _warn_on_extension_importt   warningst   warnt   localst   get(   t   selft   module_namet   error(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   _conditional_import_module-   s    	c         O   sA  t  ƒ  } x$ |  j D] } | j | j ƒ  ƒ q Wi  |  _ x | D] } t  ƒ  |  j | <q@ WxO |  j j ƒ  D]> \ } } | j t t | ƒ ƒ d  | d „ } | j | ƒ qj W|  j	 d ƒ } | r:t
 | d ƒ sÖ t ‚ t
 | d ƒ së t ‚ xL |  j j ƒ  D]8 \ } } t | d | d  ƒ } | rû | j | ƒ qû qû Wn  |  j	 d ƒ }	 |	 ri|  j d j |	 j ƒ n  |  j	 d ƒ }
 |
 r˜|  j d	 j |
 j ƒ n  |  j	 d
 ƒ } | rÞ|  j d j | j ƒ |  j d j | j ƒ n  |  j	 d ƒ } | r$|  j d j | j ƒ |  j d j | j ƒ n  t t |  ƒ j | | Ž  d  S(   Nc         S   s)   |  d  k r t j | ƒ St j | |  ƒ S(   N(   t   Nonet   hashlibt   new(   t   datat   _alg(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   _test_algorithm_via_hashlib_newB   s    t   _hashlibt   openssl_md5t   openssl_sha1t   openssl_t   _md5R   t   _shaR   t   _sha256R   R   t   _sha512R   R   (   t   sett   supported_hash_namest   addt   lowert   constructors_to_testt   itemst   getattrR'   R&   R%   t   hasattrt   AssertionErrorR(   R   R   R   R   t   superR   t   __init__(   R"   t   argst   kwargst
   algorithmst	   algorithmt   constructorsR+   R,   t   constructorR0   R1   R2   R3   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyR>   6   sB    		c         C   s^   t  j  d t d ƒ ƒ } |  j j ƒ  } x0 t j j | ƒ D] } | | ƒ } | j ƒ  q: Wd  S(   Nt   bi
   (   t   arrayt   rangeR8   t
   itervaluest	   itertoolst   chaint   from_iterablet	   hexdigest(   R"   t   aRC   t   consR   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_hash_arrayd   s
    c         C   s?   |  j  t j t g  |  j D] } | j ƒ  r | ^ q ƒ ƒ d  S(   N(   t   assertEqualR'   RA   t   tupleR5   t   islower(   R"   t   _algo(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_algorithms_attributek   s    c         C   s*   |  j  t j t d „  |  j Dƒ ƒ ƒ d  S(   Nc         s   s!   |  ] } | j  ƒ  r | Vq d  S(   N(   RR   (   t   .0RS   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pys	   <genexpr>r   s    (   RP   R'   t   algorithms_guaranteedR4   R5   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_algorithms_guaranteedp   s    c         C   s&   |  j  t t j ƒ j t j ƒ ƒ d  S(   N(   t
   assertTrueR4   R'   RV   t   issubsett   algorithms_available(   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_algorithms_availableu   s    c         C   s0   |  j  t t j d ƒ |  j  t t j d ƒ d  S(   Ns   spam spam spam spam spami   (   t   assertRaisest
   ValueErrorR'   R(   t	   TypeError(   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_unknown_hashy   s    c         C   s¬   t  j d } |  j t | d ƒ y d d  l } Wn t k
 rC n Xd  t j d <z |  j t | d ƒ Wd  d t	 ƒ  k rŠ | t j d <n
 t j d =X|  j t
 | d ƒ d  S(   Nt   __get_builtin_constructort   testiÿÿÿÿR0   R   i   (   R'   t   __dict__R\   R]   R0   R   R&   t   syst   modulesR    R^   (   R"   t   get_builtin_constructorR0   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_get_builtin_constructor}   s    c         C   sL   xE |  j  D]: } t j | ƒ } |  j t | j ƒ  ƒ | j ƒ  k ƒ q
 Wd  S(   N(   R5   R'   R(   RX   R   t   digestRL   (   R"   t   nameR
   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_hexdigest�   s    c   	      C   sî   d d } d d } d d } | | | } x» |  j  D]° } t j | ƒ } | j | ƒ | j | ƒ | j | ƒ t j | ƒ } | j | ƒ |  j | j ƒ  | j ƒ  | d ƒ t j | | ƒ } |  j | j ƒ  | j ƒ  | d ƒ q6 Wd  S(	   NRM   i€   RE   i   R   i~   s    update problem.s    new problem.(   R5   R'   R(   t   updateRP   Rg   (	   R"   t   aast   beest   ceest   abcsRh   t   m1t   m2t   m3(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_large_update•   s    


#c      
   C   sv   |  j  | } |  j t | ƒ d ƒ xL | D]D } | | ƒ j ƒ  } |  j | | d | | | t | ƒ | f ƒ q* Wd  S(   Ni   sr   Hash algorithm %s constructed using %s returned hexdigest %r for %d byte input data that should have hashed to %r.(   R8   t   assertGreaterEqualt   lenRL   RP   (   R"   Rh   R)   Rg   RC   t   hash_object_constructort   computed(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   check¨   s    c      
   C   s†   |  j  | } |  j t | ƒ d ƒ x\ | D]T } | ƒ  } | j | ƒ | j ƒ  } |  j | | d | | | t | ƒ | f ƒ q* Wd  S(   Ni   ss   Hash algorithm %s using %s when updated returned hexdigest %r for %d byte input data that should have hashed to %r.(   R8   Rs   Rt   Rj   RL   RP   (   R"   Rh   R)   Rg   RC   Ru   R
   Rv   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   check_updateµ   s    	c         C   s5   t  j | t d ƒ ƒ j ƒ  } |  j | d | ƒ d  S(   Nu   spam(   R'   R(   t   strRL   Rw   (   R"   t   algorithm_namet   expected(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   check_unicodeÄ   s    c         C   sR   |  j  d ƒ |  j  d ƒ |  j  d ƒ |  j  d ƒ |  j  d ƒ |  j  d ƒ d  S(   NR   R   R   R   R   R   (   R|   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_unicodeÉ   s    c         C   s   |  j  d d d ƒ d  S(   NR   R   t    d41d8cd98f00b204e9800998ecf8427e(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_md5_0Ó   s    c         C   s   |  j  d d d ƒ d  S(   NR   t   abct    900150983cd24fb0d6963f7d28e17f72(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_md5_1Ö   s    c         C   s   |  j  d d d ƒ d  S(   NR   t>   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789t    d174ab98d277d9f5a5611c2c9f419d9f(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_md5_2Ù   s    i   s!   test cannot run on 32-bit systemst   sizet   memusei   t   dry_runc         C   s   |  j  d d | d ƒ d  S(   NR   t   At    c9af2dff37468ce5dfee8f2cfc0a9c6d(   Rw   (   R"   R†   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_md5_hugeÝ   s    c         C   s   |  j  d d | d ƒ d  S(   NR   R‰   RŠ   (   Rx   (   R"   R†   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_md5_huge_updateâ   s    c         C   s   |  j  d d | d ƒ d  S(   NR   R‰   t    28138d306ff1b8281f1a9067e1a1a2b3(   Rw   (   R"   R†   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_md5_uintmaxç   s    c         C   s   |  j  d d d ƒ d  S(   NR   R   t(   da39a3ee5e6b4b0d3255bfef95601890afd80709(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha1_0ð   s    c         C   s   |  j  d d d ƒ d  S(   NR   R€   t(   a9993e364706816aba3e25717850c26c9cd0d89d(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha1_1ô   s    c         C   s   |  j  d d d ƒ d  S(   NR   t8   abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqt(   84983e441c3bd26ebaae4aa1f95129e5e54670f1(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha1_2ø   s    c         C   s   |  j  d d d d ƒ d  S(   NR   RM   i@B t(   34aa973cd4c4daa4f61eeb2bdbad27316534016f(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha1_3ü   s    c         C   sF   | t  d k rB y |  j d d | d ƒ WqB t k
 r> qB Xn  d  S(   Ni   R   R‰   t(   87d745c50e6b2879ffa0fb2c930e9fbfe0dc9a5b(   R   Rw   t   OverflowError(   R"   R†   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha1_huge   s    c         C   sF   | t  d k rB y |  j d d | d ƒ WqB t k
 r> qB Xn  d  S(   Ni   R   R‰   R˜   (   R   Rx   R™   (   R"   R†   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha1_huge_update	  s    c         C   s   |  j  d d d ƒ d  S(   NR   R   t8   d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha224_0  s    c         C   s   |  j  d d d ƒ d  S(   NR   R€   t8   23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha224_1  s    c         C   s   |  j  d d d ƒ d  S(   NR   R“   t8   75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha224_2  s    	c         C   s   |  j  d d d d ƒ d  S(   NR   RM   i@B t8   20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha224_3#  s    c         C   s   |  j  d d d ƒ d  S(   NR   R   t@   e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha256_0(  s    c         C   s   |  j  d d d ƒ d  S(   NR   R€   t@   ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha256_1,  s    c         C   s   |  j  d d d ƒ d  S(   NR   R“   t@   248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha256_20  s    	c         C   s   |  j  d d d d ƒ d  S(   NR   RM   i@B t@   cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha256_35  s    c         C   s   |  j  d d d d ƒ d  S(   NR   R   t@   38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1dat    274edebfe76f65fbd51ad2f14898b95b(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha384_0:  s    c         C   s   |  j  d d d d ƒ d  S(   NR   R€   t@   cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bedt    8086072ba1e7cc2358baeca134c825a7(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha384_1?  s    c         C   s   |  j  d d d d d ƒ d  S(   NR   t8   abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnt8   hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstut@   09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712t    fcc7c71a557e2db966c3e9fa91746039(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha384_2D  s
    	c         C   s   |  j  d d d d d ƒ d  S(   NR   RM   i@B t@   9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5bt    07b8b3dc38ecc4ebae97ddd87f3d8985(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha384_3K  s    c         C   s   |  j  d d d d ƒ d  S(   NR   R   t@   cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9cet@   47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha512_0Q  s    c         C   s   |  j  d d d d ƒ d  S(   NR   R€   t@   ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39at@   2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha512_1V  s    c         C   s   |  j  d d d d d ƒ d  S(   NR   R²   R³   t@   8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018t@   501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha512_2[  s
    	c         C   s   |  j  d d d d d ƒ d  S(   NR   RM   i@B t@   e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebt@   de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b(   Rw   (   R"   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_case_sha512_3b  s    s!   Threading required for this test.c   	         s$  t  j ƒ  ‰ d } d } | d ‰  t  j ˆ  | ƒ j ƒ  } ‡  ‡ f d †  } g  } x~ t | ƒ D]p } t ˆ  ƒ d | } | d k sŒ t ‚ | t | ƒ d k s¨ t ‚ t j d | d | f ƒ } | j | ƒ q` Wx | D] } | j	 ƒ  qÛ Wx | D] } | j
 ƒ  qö W|  j | ˆ j ƒ  ƒ d  S(	   Ni   t   swineflui@ c            sE   d } x8 | t  ˆ  ƒ k  r@ ˆ j ˆ  | | |  !ƒ | |  7} q	 Wd  S(   Ni    (   Rt   Rj   (   t
   chunk_sizet   index(   R)   t   hasher(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   hash_in_chunksv  s    i
   i    t   targetR?   (   R'   R   RL   t   xrangeRt   R<   t	   threadingt   Threadt   appendt   startt   joinRP   (	   R"   t   num_threadst   smallest_datat   expected_hashRÊ   t   threadst	   threadnumRÇ   t   thread(    (   R)   RÉ   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_threaded_hashingg  s&    	
(   R   R   R   R   R   R   R   R   R   R   R   R   (;   t   __name__t
   __module__R5   t   COMPILED_WITH_PYDEBUGR   R%   R>   RO   RT   RW   R[   R_   Rf   Ri   Rr   Rw   Rx   R|   R}   R   R‚   R…   t   unittestt   skipIfRc   t   maxsizeR   R   t   FalseR‹   RŒ   RŽ   R�   R’   R•   R—   Rš   R›   R�   RŸ   R¡   R£   R¥   R§   R©   R«   R®   R±   R¶   R¹   R¼   R¿   RÂ   RÅ   t
   skipUnlessRÍ   R   t   reap_threadsRØ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyR   &   sf     			.												
			+++				"	"																t   KDFTestsc           B   s"  e  Z d" d# d$ d% d& g Z i e d ƒ d! f e d ƒ d! f e d ƒ d! f e d ƒ d f e d ƒ d! f g d 6e d ƒ d! f e d ƒ d! f e d ƒ d! f e d ƒ d f e d ƒ d! f g d 6e d ƒ d! f e d ƒ d! f e d ƒ d! f e d ƒ d f e d ƒ d! f g d 6Z d  „  Z RS('   t   passwordt   salti   i   i   t   passwordPASSWORDpasswordt$   saltSALTsaltSALTsaltSALTsaltSALTsaltiÿÿÿÿs	   pass words   sa lti   t(   0c60c80f961f0e71f3a9b524af6012062fe037a6t(   ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957t(   4b007901b765489abead49d926f721d065a429c1t2   3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038i   t    56fa6aa75548099dcc37d7f03425e0c3R   t@   120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17bt@   ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43t@   c5e478d59288c841aa530db6845c4c8d962893a001ce4e11a4963873aa98134atP   348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9i(   t    89b69d0516f829893c696226650a8687R   t€   867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252c02d470a285a0501bad999bfe943c08f050235d7d68b1da55e63f73b60a57fcet€   e1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f0040713f18aefdb866d53cf76cab2868a39b9f7840edce4fef5a82be67335c77a6068e04112754f27ccf4et€   d197b1b33db0143e018b12f3d1d1479e6cdebdcc97c5c0f87f6902e072f457b5143f30602641b3d55cd335988cb36b84376060ecd532e039b742a239434af2d5t€   8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b868c005174dc4ee71115b59f9e60cd9532fa33e0f75aefe30225c583a186cd82bd4daea9724a3d3b8i@   t    9d9e9c4cd21fe4be24d5b8244c759665R   c      
   C   s²   x« |  j  j ƒ  D]š \ } } x‹ t |  j ƒ D]z \ } } | \ } } } } | | \ }	 }
 |
 ri |
 } n  t j | | | | | ƒ } |  j | |	 | | | | | f ƒ q, Wq Wd  S(   N(   t   pbkdf2_resultsR9   t	   enumeratet   pbkdf2_test_vectorsR'   t   pbkdf2_hmacRP   (   R"   t   digest_namet   resultsR   t   vectorRã   Rä   t   roundst   dklenR{   t   overwrite_dklent   out(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   test_pbkdf2_hmac¿  s    	N(   Rã   Rä   i   N(   Rã   Rä   i   N(   Rã   Rä   i   N(   Rå   Ræ   i   iÿÿÿÿ(   s	   pass words   sa lti   i   (   RÙ   RÚ   R&   Rø   R    Rö   R  (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyRâ   �  s@    										c           C   s   t  j t t ƒ d  S(   N(   R   t   run_unittestR   Râ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt	   test_mainÌ  s    t   __main__(   RF   R'   RI   Rc   RÍ   R   R&   RÜ   R   t   binasciiR    Ra   R   t   test.test_supportR   R   R;   RÛ   R   t   TestCaseR   Râ   R  RÙ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_hashlib.pyt   <module>	   s(   
	
ÿ h?	