403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyc
ó
p‘ÇZc@s-dZdZddlZddlZddlmZmZddlTejdkr_d„Z	ne	Z	ddd	„ƒYZ
e
d
„Zdejfd„ƒYZ
d
e
fd„ƒYZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZd„Zd„ZdS(s&Self-testing for PyCrypto hash moduless$Id$iÿÿÿÿN(ta2b_hextb2a_hex(t*icKs
|jƒS(N(tcopy(tkwargs((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pytdict&st
_NoDefaultcBseZRS((t__name__t
__module__(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR+scCs@y||}Wn$tk
r4|tkr0‚n|SX||=|S(sAGet an item from a dictionary, and remove it from the dictionary.(tKeyErrorR(tdtktdefaulttretval((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyt_extract,s
tCipherSelfTestcBs,eZd„Zd„Zd„Zd„ZRS(cCs5tjj|ƒ||_|jƒ}t|dƒ|_tt|dƒƒ|_tt|dƒƒ|_	tt|dƒƒ|_
t|ddƒ|_t|ddƒ}t
|ƒ|_|dk	rt|jd|ƒ|_t|ddƒ|_|jdk	r(t|jƒ|_q(nd|_d|_||_dS(	Ntdescriptiontkeyt	plaintextt
ciphertexttmodule_nametmodetMODE_tiv(tunittesttTestCaset__init__tmoduleRRRtbRRRtNoneRtstrt	mode_nametgetattrRRtextra_params(tselfRtparamsR((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR:s$			cCs|jS(N(R(R"((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pytshortDescriptionTscCs¾|jjƒ}t|jdƒr0|j|jjkr0ddlm}t|d|j	ƒ}t|diƒjƒ}|j
dƒrŸtt|dƒƒ|d<n|j
dƒrËtt|dƒƒ|d<n|j
dƒsd	|jj
t|jdd
ƒƒt|jdd
ƒƒ|d<n|||d<n|jdkr[|jj	t|jƒ|S|jdkrŒ|jj	t|jƒ|j|S|jj	t|jƒ|jt|jƒ|SdS(NtMODE_CTRiÿÿÿÿ(tCountert	ctr_classt
ctr_paramstprefixtsuffixtnbitsittcounter(R!RthasattrRRR%tCrypto.UtilR&Rtnewthas_keyRRt
block_sizetlentgetRRR(R"R#R&R'R(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyt_newWs"'C"cCsÚt|jƒ}t|jƒ}t|jƒj|ƒƒ}t|jƒj|ƒƒ}t|jƒj|ƒƒ}t|jƒj|ƒƒ}|j|j|ƒ|j|j|ƒ|j|j|ƒ|j|j|ƒdS(N(RRRRR5tencrypttdecrypttassertEqual(R"RRtct1tpt1tct2tpt2((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pytrunTestos(RRRR$R5R=(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR8s			tCipherStreamingSelfTestcBseZd„Zd„ZRS(cCs:|j}|jdk	r/|d|jf7}nd|fS(Ns in %s modes%%s should behave like a stream cipher(RRRR(R"tdesc((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR$s	cCs*t|jƒ}t|jƒ}g}|jƒ}xAtdt|ƒdƒD]'}|j|j|||d!ƒƒqIWtt	dƒj
|ƒƒ}|j|j|ƒg}|jƒ}xAtdt|ƒdƒD]'}|j|j|||d!ƒƒqÍWtt	dƒj
|ƒƒ}|j|j|ƒdS(NiiR,(RRRR5trangeR3tappendR6RRtjoinR8(R"RRtct3tciphertitpt3((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR=…s%%(RRR$R=(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR>}s	tCTRSegfaultTestcBs#eZd„Zd„Zd„ZRS(cCsEtjj|ƒ||_t|dƒ|_|jddƒ|_dS(NRR(	RRRRRRR4RR(R"RR#((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyRžs	cCsd|j|jfS(NsNRegression test: %s.new(key, %s.MODE_CTR) should raise TypeError, not segfault(R(R"((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR$¤scCs/|jt|jjt|jƒ|jjƒdS(N(tassertRaisest	TypeErrorRR0RRR%(R"((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR=§s(RRRR$R=(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyRGœs		tCTRWraparoundTestcBs#eZd„Zd„Zd„ZRS(cCsEtjj|ƒ||_t|dƒ|_|jddƒ|_dS(NRR(	RRRRRRR4RR(R"RR#((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR¬s	cCsd|jfS(Ns]Regression test: %s with MODE_CTR should raise OverflowError on wraparound when shortcut used(R(R"((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR$²sc
CsÖddlm}x¿dD]·}x®d
D]¦}|jd|jjddd|jjdd|d	|ƒ}|jjt|jƒ|jjd
|ƒ}tdƒ|jj}|j	|ƒ|j
t|j	|ƒq$WqWdS(Niÿÿÿÿ(R&iiit
initial_valuelt
little_endiantdisable_shortcutR-t(ii(ii(R/R&R0RR2RRR%RR6RHt
OverflowError(R"R&RMRLtctrRDtblock((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR=µs

=*
(RRRR$R=(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyRJªs		tCFBSegmentSizeTestcBs#eZd„Zd„Zd„ZRS(cCs=tjj|ƒ||_t|dƒ|_|d|_dS(NRR(RRRRRRR(R"RR#((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyRÂs	cCs|jS(N(R(R"((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR$ÈscCswxHtddƒD]7}|jt|jjt|jƒ|jjd|ƒqW|jjt|jƒ|jjddƒdS(snRegression test: m.new(key, m.MODE_CFB, segment_size=N) should require segment_size to be a multiple of 8 bitsiitsegment_sizeN(R@RHt
ValueErrorRR0RRtMODE_CFB(R"RE((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR=Ës5(RRRR$R=(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyRRÀs		t
RoundtripTestcBs#eZd„Zd„Zd„ZRS(cCsddlm}tjj|ƒ||_|j|jƒ|_t	|dƒ|_
dt	|dƒ|_|jddƒ|_dS(Niÿÿÿÿ(tRandomRidRR(tCryptoRWRRRRtget_random_bytesR2RRRRR4RR(R"RR#RW((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyRÒs	cCsd|jfS(Ns8%s .decrypt() output of .encrypt() should not be garbled(R(R"((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR$ÛscCs(|jj}|jjt|jƒ|ƒ}|j|jƒ}|jjt|jƒ|ƒ}|j|ƒ}|j|j|ƒx¥|jj	|jj
|jjfD]‚}|jjt|jƒ||jƒ}|jjt|jƒ||jƒ}|j|jƒ}|j|ƒ}|j|j|ƒqžWdS(N(
RtMODE_ECBR0RRR6RR7R8tMODE_CBCRUtMODE_OFBR(R"Rtencryption_cipherRtdecryption_ciphertdecrypted_plaintext((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyR=Þs($$(RRRR$R=(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyRVÑs			c	Csg}d}xtt|ƒƒD]ô}||}idd6}t|ƒdkrl|\|d<|d<|d<n—t|ƒdkr£|\|d<|d<|d<|d	<n`t|ƒd
krê|\|d<|d<|d<|d	<}|j|ƒntdt|ƒfƒ‚|jƒ}	t|	dƒ}
t|	dƒ}t|	dƒ}t|	d	dƒ}
|	jddƒ}|dkrt|	ddƒn|
dk	r”|
}n9|dkrº|	rºd||
f}nd
||
|	f}d||d|f}||d	<||d<|sA|t||ƒt	||ƒt
||ƒt||ƒg7}d}n|jt
||ƒƒ|dkr||jt||ƒƒn|dkr|jdƒr|jƒ}|d	cd7<|jdiƒjƒ}||d<|djdƒsúd|dd<n|jt
||ƒƒqqW|S(NitECBRiRRRiRisUnsupported tuple size %ds
p=%s, k=%ssp=%s, k=%s, %rs
%s #%d: %siRtCTRR's (shortcut disabled)R(RM(R@R3tupdatetAssertionErrorRRRR4RGRJRRRVRARR>R1(RRt	test_datatteststextra_tests_addedREtrowR#R!tp2tp_keytp_plaintexttp_ciphertextt
p_descriptiontp_modeRtnametparams2tctr_params2((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pytmake_block_testsðs`

%%	

	
cCság}xÔtt|ƒƒD]À}||}i}t|ƒdkr_|\|d<|d<|d<n—t|ƒdkr–|\|d<|d<|d<|d<n`t|ƒdkrÝ|\|d<|d<|d<|d<}|j|ƒntdt|ƒfƒ‚|jƒ}t|dƒ}	t|dƒ}
t|dƒ}t|ddƒ}|dk	rV|}
n,|sod	|
|	f}
nd
|
|	|f}
d||d|
f}||d<||d
<|jt||ƒƒ|jt	||ƒƒqW|S(NiRRRiRisUnsupported tuple size %ds
p=%s, k=%ssp=%s, k=%s, %rs
%s #%d: %siR(
R@R3RbRcRRRRARR>(RRRdReRERgR#R!RhRiRjRkRlRRn((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pytmake_stream_tests2s8
%%	

((t__doc__t__revision__tsysRtbinasciiRRtCrypto.Util.py3compatt
hexversionRRRRRR>RGRJRRRVRqRr(((sA/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Cipher/common.pyt<module>s$
E	B

Youez - 2016 - github.com/yon3zu
LinuXploit