Current File : //opt/imh-python/lib/python2.7/test/test_hashlib.pyo
�
��Wc@sddlZddlZddlZddlZyddlZWnek
rYeZnXddlZddlZddl	m
Z
ddlmZddl
mZmZeed�Zd�Zdejfd��YZd	ejfd
��YZd�Zedkre�ndS(
i����N(t	unhexlify(ttest_support(t_4GtprecisionbigmemtesttgettotalrefcountcCs^ddl}|j}d}x<|D]4}t|�}|||d?d@||d@}q"W|S(Ni����tii(tstringt	hexdigitstord(tsRthtrtcti((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pythexstrs	
&tHashLibTestCasecBs�eZd>ZeZd�Zd
�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zejejedkd�ededd d!d"e�d#���Zejejedkd�ededd d!d"e�d$���Zejejed!kd�eded!d d!d"e�d%���Zd&�Z d'�Z!d(�Z"d)�Z#ededd d!�d*��Z$ededd d!�d+��Z%d,�Z&d-�Z'd.�Z(d/�Z)d0�Z*d1�Z+d2�Z,d3�Z-d4�Z.d5�Z/d6�Z0d7�Z1d8�Z2d9�Z3d:�Z4d;�Z5ej6e7d<�e8j9d=���Z:RS(?tmd5tMD5tsha1tSHA1tsha224tSHA224tsha256tSHA256tsha384tSHA384tsha512tSHA512cBsSyd|dUWn0ek
rB}|jrCejd|�qCnXe�j|�S(s@Import a module and return a reference to it or None on failure.simport Ns%Did a C extension fail to compile? %s(tImportErrort_warn_on_extension_importtwarningstwarntlocalstget(tselftmodule_nameterror((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyt_conditional_import_module-s	c
Ost�}x$|jD]}|j|j��qWi|_x|D]}t�|j|<q@WxO|jj�D]>\}}|jtt|��d|d�}|j|�qjW|j	d�}|rxL|jj�D]8\}}t|d|d�}|r�|j|�q�q�Wn|j	d�}	|	r?|jdj|	j
�n|j	d�}
|
rn|jdj|
j
�n|j	d�}|r�|jd	j|j�|jd
j|j�n|j	d�}|r�|jdj|j
�|jd
j|j�ntt|�j||�dS(NcSs)|dkrtj|�Stj||�S(N(tNonethashlibtnew(tdatat_alg((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyt_test_algorithm_via_hashlib_newBs
t_hashlibtopenssl_t_md5Rt_shaRt_sha256RRt_sha512RR(tsettsupported_hash_namestaddtlowertconstructors_to_testtitemstgetattrR'R&R%R(RRRRtsuperRt__init__(
R"targstkwargst
algorithmst	algorithmtconstructorsR+R,tconstructorR.R/R0R1((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyR:6s>		
cCs^tjdtd��}|jj�}x0tjj|�D]}||�}|j�q:WdS(Ntbi
(tarraytrangeR6t
itervaluest	itertoolstchaint
from_iterablet	hexdigest(R"taR?tconsR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_hash_arrayds
cCs?|jtjtg|jD]}|j�r|^q��dS(N(tassertEqualR'R=ttupleR3tislower(R"t_algo((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_algorithms_attributekscCs*|jtjtd�|jD���dS(Ncss!|]}|j�r|VqdS(N(RN(t.0RO((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pys	<genexpr>rs(RLR'talgorithms_guaranteedR2R3(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_algorithms_guaranteedpscCs&|jttj�jtj��dS(N(t
assertTrueR2R'RRtissubsettalgorithms_available(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_algorithms_availableuscCs0|jttjd�|jttjd�dS(Nsspam spam spam spam spami(tassertRaisest
ValueErrorR'R(t	TypeError(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_unknown_hashyscCs�tjd}|jt|d�yddl}Wntk
rCnXdtjd<z|jt|d�Wddt	�kr�|tjd<n
tjd=X|jt
|d�dS(Nt__get_builtin_constructorttesti����R.Ri(R't__dict__RXRYR.RR&tsystmodulesR RZ(R"tget_builtin_constructorR.((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_get_builtin_constructor}s

cCsLxE|jD]:}tj|�}|jt|j��|j�k�q
WdS(N(R3R'R(RTRtdigestRH(R"tnameR
((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_hexdigest�sc	Cs�dd}dd}dd}|||}x�|jD]�}tj|�}|j|�|j|�|j|�tj|�}|j|�|j|j�|j�|d�tj||�}|j|j�|j�|d�q6WdS(	NRIi�RAiRi~s update problem.s
 new problem.(R3R'R(tupdateRLRc(	R"taastbeestceestabcsRdtm1tm2tm3((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_large_update�s






#c
Csv|j|}|jt|�d�xL|D]D}||�j�}|j||d|||t|�|f�q*WdS(NisrHash algorithm %s constructed using %s returned hexdigest %r for %d byte input data that should have hashed to %r.(R6tassertGreaterEqualtlenRHRL(R"RdR)RcR?thash_object_constructortcomputed((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pytcheck�s

c
Cs�|j|}|jt|�d�x\|D]T}|�}|j|�|j�}|j||d|||t|�|f�q*WdS(NissHash algorithm %s using %s when updated returned hexdigest %r for %d byte input data that should have hashed to %r.(R6RoRpRfRHRL(R"RdR)RcR?RqR
Rr((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pytcheck_update�s

	
cCs5tj|td��j�}|j|d|�dS(Nuspam(R'R(tstrRHRs(R"talgorithm_nametexpected((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyt
check_unicode�scCsR|jd�|jd�|jd�|jd�|jd�|jd�dS(NRRRRRR(Rx(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_unicode�s




cCs|jddd�dS(NRRt d41d8cd98f00b204e9800998ecf8427e(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_md5_0�scCs|jddd�dS(NRtabct 900150983cd24fb0d6963f7d28e17f72(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_md5_1�scCs|jddd�dS(NRt>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789t d174ab98d277d9f5a5611c2c9f419d9f(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_md5_2�sis!test cannot run on 32-bit systemstsizetmemuseitdry_runcCs|jdd|d�dS(NRtAt c9af2dff37468ce5dfee8f2cfc0a9c6d(Rs(R"R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_md5_huge�scCs|jdd|d�dS(NRR�R�(Rt(R"R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_md5_huge_update�scCs|jdd|d�dS(NRR�t 28138d306ff1b8281f1a9067e1a1a2b3(Rs(R"R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_md5_uintmax�scCs|jddd�dS(NRRt(da39a3ee5e6b4b0d3255bfef95601890afd80709(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha1_0�scCs|jddd�dS(NRR|t(a9993e364706816aba3e25717850c26c9cd0d89d(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha1_1�scCs|jddd�dS(NRt8abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqt(84983e441c3bd26ebaae4aa1f95129e5e54670f1(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha1_2�scCs|jdddd�dS(NRRIi@Bt(34aa973cd4c4daa4f61eeb2bdbad27316534016f(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha1_3�scCsF|tdkrBy|jdd|d�WqBtk
r>qBXndS(NiRR�t(87d745c50e6b2879ffa0fb2c930e9fbfe0dc9a5b(RRst
OverflowError(R"R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha1_huges
cCsF|tdkrBy|jdd|d�WqBtk
r>qBXndS(NiRR�R�(RRtR�(R"R�((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha1_huge_update	s
cCs|jddd�dS(NRRt8d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha224_0scCs|jddd�dS(NRR|t823097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha224_1scCs|jddd�dS(NRR�t875388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha224_2s	cCs|jdddd�dS(NRRIi@Bt820794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha224_3#scCs|jddd�dS(NRRt@e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha256_0(scCs|jddd�dS(NRR|t@ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha256_1,scCs|jddd�dS(NRR�t@248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha256_20s	cCs|jdddd�dS(NRRIi@Bt@cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha256_35scCs|jdddd�dS(NRRt@38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1dat 274edebfe76f65fbd51ad2f14898b95b(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha384_0:scCs|jdddd�dS(NRR|t@cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bedt 8086072ba1e7cc2358baeca134c825a7(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha384_1?scCs|jddddd�dS(NRt8abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnt8hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstut@09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712t fcc7c71a557e2db966c3e9fa91746039(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha384_2Ds
	cCs|jddddd�dS(NRRIi@Bt@9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5bt 07b8b3dc38ecc4ebae97ddd87f3d8985(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha384_3KscCs|jdddd�dS(NRRt@cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9cet@47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha512_0QscCs|jdddd�dS(NRR|t@ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39at@2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha512_1VscCs|jddddd�dS(NRR�R�t@8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018t@501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha512_2[s
	cCs|jddddd�dS(NRRIi@Bt@e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebt@de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b(Rs(R"((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_case_sha512_3bss!Threading required for this test.c	s�tj��d}d}|d�tj�|�j�}��fd�}g}xct|�D]U}t��d|}tj�}|j|�tjd|d||f�j	�q`Wx|D]}|j
�q�W|j|�j��dS(Nitswineflui@
csOd}x8|t��kr@�j�|||!�||7}q	W|j�dS(Ni(RpRfR2(t
chunk_sizeteventtindex(R)thasher(sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pythash_in_chunksvs
i
ttargetR;(R'RRHtxrangeRpt	threadingtEventtappendtThreadtstarttwaitRL(	R"tnum_threadst
smallest_datat
expected_hashR�teventst	threadnumR�R�((R)R�sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_threaded_hashinggs 	


(smd5Rssha1Rssha224Rssha256Rssha384Rssha512R(;t__name__t
__module__R3tCOMPILED_WITH_PYDEBUGRR%R:RKRPRSRWR[RbReRnRsRtRxRyR{R~R�tunittesttskipIfR_tmaxsizeRRtFalseR�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�Rtreap_threadsR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyR&sf			.									
			
			+++				"	"
																tKDFTestscBs"eZd"d#d$d%d&gZied�d!fed�d!fed
�d!fed�dfed�d!fgd6ed�d!fed�d!fed�d!fed�dfed�d!fgd6ed�d!fed�d!fed�d!fed�dfed�d!fgd6Zd �ZRS('tpasswordtsaltiiitpasswordPASSWORDpasswordt$saltSALTsaltSALTsaltSALTsaltSALTsalti����t	passwordtsaltit(0c60c80f961f0e71f3a9b524af6012062fe037a6t(ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957t(4b007901b765489abead49d926f721d065a429c1t23d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038it 56fa6aa75548099dcc37d7f03425e0c3Rt@120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17bt@ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43t@c5e478d59288c841aa530db6845c4c8d962893a001ce4e11a4963873aa98134atP348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9i(t 89b69d0516f829893c696226650a8687Rt�867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252c02d470a285a0501bad999bfe943c08f050235d7d68b1da55e63f73b60a57fcet�e1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f0040713f18aefdb866d53cf76cab2868a39b9f7840edce4fef5a82be67335c77a6068e04112754f27ccf4et�d197b1b33db0143e018b12f3d1d1479e6cdebdcc97c5c0f87f6902e072f457b5143f30602641b3d55cd335988cb36b84376060ecd532e039b742a239434af2d5t�8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b868c005174dc4ee71115b59f9e60cd9532fa33e0f75aefe30225c583a186cd82bd4daea9724a3d3b8i@t 9d9e9c4cd21fe4be24d5b8244c759665Rc
Cs�x�|jj�D]�\}}x�t|j�D]z\}}|\}}}}||\}	}
|
ri|
}ntj|||||�}|j||	|||||f�q,WqWdS(N(tpbkdf2_resultsR7t	enumeratetpbkdf2_test_vectorsR'tpbkdf2_hmacRL(R"tdigest_nametresultsR
tvectorR�R�troundstdklenRwtoverwrite_dklentout((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyttest_pbkdf2_hmac�s	N(spasswordssaltiN(spasswordssaltiN(spasswordssaltiN(R�R�ii����(R�R�ii(R�R�R&R�RR�R(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyR��s@										cCstjtt�dS(N(Rtrun_unittestRR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyt	test_main�st__main__(RBR'RER_R�RR&R�RtbinasciiRR]Rttest.test_supportRRthasattrR�RtTestCaseRR�RR�(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_hashlib.pyt<module>	s(

	
�h?