Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/__pycache__/djbec.cpython-33.pyc

�
�/6Rcc@s+y2edHZdd�Zdd�Zdd�ZWn0ek
rddIZeZeZdd�ZYnXddl	Z	d	Z
dKZdMZdd�Z
dd�Zdd�ZdNed�Zed
edde�Zdd�Zded�Zee�ZeeeegZdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z d2d3�Z!d4d5�Z"d6d7�Z#d8d9�Z$eZ%d:Z&d;d<�Z'd=d>�Z(d?d@dA�Z)ddl*Z*ddBdC�Z+dDdE�Z,dFdG�Z-dS(OcCsdjdd�|D��S(u(Convert array of integers to byte stringucss|]}t|�VqdS(N(uchr(u.0ux((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	<genexpr>suasbytes.<locals>.<genexpr>(ujoin(ub((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuasbytessuasbytescCs
dj|�S(u%Convert array of bytes to byte stringu(ujoin(ub((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	joinbytessu	joinbytescCst||d�|d?d@S(uReturn i'th bit of bytestring hii(uord(uhui((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyubitsubitcCs||d|d?d@S(Nii((uhui((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyubitsiNiii�ii�l	�S�9i�@eM�^�w|ocCstj|�j�S(N(uhashlibusha512udigest(um((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuH#suHcCsM|dkrdSt||d|�d|}|d@rI|||}n|S(Niii(uexpmod(ubueumut((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuexpmod&s
uexpmodcCst|tdt�S(Ni(uexpmoduq(ux((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuinv.suinviA�iB�iicCs�||dtt||d�}t|tddt�}|||tdkrg|tt}n|ddkr�t|}n|S(Niiiii(uinvuduexpmoduquI(uyuxxux((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuxrecover4s$
uxrecovericCs�|\}}}}|\}}}}	||||t}
||||t}|d|	t}|d|t}
|
|t}||
t}||
t}|
|t}||t}||t}||t}||t}||||fS(Ni(uq(upt1upt2uX1uY1uZ1uT1uX2uY2uZ2uT2uAuBuCuDuEuFuGuHuX3uY3uZ3uT3((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuxpt_addRsuxpt_addcCs�|\}}}}||}||}d||}|t}||t}	|	|	||t}
||t}||t}||t}
|
|t}||
t}||t}|
|
t}||||fS(Ni(uq(uptuX1uY1uZ1u_uAuBuCuDuJuEuGuFuHuX3uY3uZ3uT3((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
xpt_doublecs

u
xpt_doublecCs$|\}}||d||tfS(Ni(uq(uptuxuy((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyupt_xformtsupt_xformcCs8|\}}}}|t|�t|t|�tfS(N(uinvuq(uptuxuyuzu_((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
pt_unxformxsu
pt_unxformcCsJ|dkrtd�Stt||d?��}|d@rFt||�S|S(Nii(ii(upt_xformu
xpt_doubleuxpt_multuxpt_add(uptunu_((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuxpt_mult|s
uxpt_multcCsttt|�|��S(N(u
pt_unxformuxpt_multupt_xform(uptue((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
scalarmult�su
scalarmultcsL�fdd�tt�D���fdd�ttd�D�}t|�S(Ncsg|]}�|?d@�qS(i((u.0ui(uy(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
<listcomp>�s	uencodeint.<locals>.<listcomp>cs8g|].�t��fdd�td�D���qS(cs&g|]}��d||>�qS(i((u.0uj(ubitsui(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
<listcomp>�s	u(encodeint.<locals>.<listcomp>.<listcomp>i(usumurange(u.0(ubits(uiuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
<listcomp>�s	i(urangeubuasbytes(uyue((ubitsuyuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	encodeint�su	encodeintcso|d}|d��fdd�ttd�D�|d@g��fdd�ttd�D�}t|�S(Niicsg|]}�|?d@�qS(i((u.0ui(uy(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
<listcomp>�s	uencodepoint.<locals>.<listcomp>cs8g|].�t��fdd�td�D���qS(cs&g|]}��d||>�qS(i((u.0uj(ubitsui(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
<listcomp>�s	u*encodepoint.<locals>.<listcomp>.<listcomp>i(usumurange(u.0(ubits(uiuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
<listcomp>�s	i(urangeubuasbytes(uPuxue((ubitsuyuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuencodepoint�s

.uencodepointcs]t|��dtdt�fdd�tdtd�D��}tt|�}t|�S(Nic3s&|]}d|t�|�VqdS(iN(ubit(u.0ui(uh(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	<genexpr>�supublickey.<locals>.<genexpr>i(uHubusumurangeu
scalarmultuBuencodepoint(uskuauA((uhuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	publickey�s8u	publickeycs3t|��t�fdd�tdt�D��S(Nc3s&|]}d|t�|�VqdS(iN(ubit(u.0ui(uh(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	<genexpr>�suHint.<locals>.<genexpr>i(uHusumurangeub(um((uhuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuHint�suHintcs�t|��dtdt�fdd�tdtd�D��}t�fdd�ttdtd�D��}t||�}tt|�}|tt|�||�|t	}t|�t
|�S(	Nic3s&|]}d|t�|�VqdS(iN(ubit(u.0ui(uh(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	<genexpr>�susignature.<locals>.<genexpr>icsg|]}�|�qS(((u.0ui(uh(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
<listcomp>�s	usignature.<locals>.<listcomp>ii(uHubusumurangeu	joinbytesuHintu
scalarmultuBuencodepointulu	encodeint(umuskupkuauinteruruRuS((uhuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	signature�s80&u	signaturecCsG|d}|d}||||dt||||tdkS(Nii(uduq(uPuxuy((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	isoncurve�s

u	isoncurvecs&t�fdd�tdt�D��S(Nc3s&|]}d|t�|�VqdS(iN(ubit(u.0ui(us(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	<genexpr>�sudecodeint.<locals>.<genexpr>i(usumurangeub(us((usuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	decodeint�su	decodeintcs�t�fdd�tdtd�D��}t|�}|d@t�td�krbt|}n||g}t|�s�td��n|S(Nc3s&|]}d|t�|�VqdS(iN(ubit(u.0ui(us(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu	<genexpr>�sudecodepoint.<locals>.<genexpr>iiu#decoding point that is not on curve(usumurangeubuxrecoverubituqu	isoncurveu	Exception(usuyuxuP((usuG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyudecodepoint�s,
udecodepointc	Cs�t|�tdkr%td��nt|�tdkrJtd��nt|dtd��}t|�}t|tdtd��}tt|�||�}tt|�}t	t
t|�tt||����}||kS(Niusignature length is wrongiupublic-key length is wrongi(ulenubu	Exceptionudecodepointu	decodeintuHintuencodepointu
scalarmultuBu
pt_unxformuxpt_addupt_xform(	usumupkuRuAuSuhuv1uv2((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
checkvalid�s*u
checkvalidimcCsr|\}}|\}}|\}}d||||d|}	d||||d|}
|	t|
tfS(Nii(uP(unumuduxnuznuxmuzmuxduzduxuz((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuadd�suaddcCs^|\}}|d|dd}d|||dt|||d}|t|tfS(Nii(uAuP(unuxnuznuxuz((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyudouble�s*udoublei	csZ|df�t������fdd���|�\\}}}|t|�tS(Nicsn|dkr��fS�|d�\}}|d@rRt||��t|�fSt|�t||��fS(Nii(uaddudouble(umupmupm1(ufuoneutwo(uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyuf�s

ucurve25519.<locals>.f(udoubleuinvuP(unubaseuxuzu_((ufuoneutwouG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu
curve25519�s
u
curve25519cCs:|ptjdt�}|dM}|d
M}|dO}|S(
Niii�iii@i����i�ll��i�l@(urandomurandintuP(un((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyugenkey�s



ugenkeycCsnddl}ttjttt��jd�}|jd�}t|�}t|||�}t	|||�S(Niuutf-8i (
uosustrurandomurandintuquencodeuurandomu	publickeyu	signatureu
checkvalid(uosumsguskupkusig((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyudsa_tests%udsa_testcCs:t�}t�}t|t|��t|t|��kS(N(ugenkeyu
curve25519(usk1usk2((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyudh_test
s		udh_testFTll�����������������ll�S�9i�@eM�^�w|oi�$��(.uunicodeuFalseuPY3uasbytesu	joinbytesubitu	NameErroruTrueubytesuhashlibubuquluHuexpmoduinvuduIuxrecoveruByuBxuBuxpt_addu
xpt_doubleupt_xformu
pt_unxformuxpt_multu
scalarmultu	encodeintuencodepointu	publickeyuHintu	signatureu	isoncurveu	decodeintudecodepointu
checkvaliduPuAuaddudoubleu
curve25519urandomugenkeyudsa_testudh_test(((uG/opt/alt/python33/lib/python3.3/site-packages/wheel/signatures/djbec.pyu<module>	s^