Ë
    V.jÔ  ã                   óX  — d dl mZ 	 d dlmZ dZd dlmZ ddl	m
Z
 ddlmZmZmZmZ dd	lmZ dd
lmZmZmZ e G d„ de«      «       Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z eddd«      Zy# e$ r 	 d dlmZ dZn# e$ r dZY nw xY wY Œ˜w xY w)é    )Údivision)ÚmpzTF)Úpython_2_unicode_compatibleé   )Únumbertheory)Únormalise_bytesÚint_to_bytesÚ
bit_lengthÚbytes_to_int)ÚMalformedPointError)ÚorderlenÚstring_to_numberÚnumber_to_stringc                   ó\   — e Zd ZdZerdd„Zndd„Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Zy)ÚCurveFpzd
    :term:`Short Weierstrass Elliptic Curve <short Weierstrass curve>` over a
    prime field.
    Nc                 ór   — t        |«      | _        t        |«      | _        t        |«      | _        || _        y©a�  
            The curve of points satisfying y^2 = x^3 + a*x + b (mod p).

            h is an integer that is the cofactor of the elliptic curve domain
            parameters; it is the number of points satisfying the elliptic
            curve equation divided by the order of the base point. It is used
            for selection of efficient algorithm for public point verification.
            N)r   Ú_CurveFp__pÚ_CurveFp__aÚ_CurveFp__bÚ_CurveFp__h©ÚselfÚpÚaÚbÚhs        úUC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\ecdsa/ellipticcurve.pyÚ__init__zCurveFp.__init__B   s.   € ô ˜1“vˆDŒHÜ˜1“vˆDŒHÜ˜1“vˆDŒHð ˆD�Hó    c                 ó<   — || _         || _        || _        || _        yr   )r   r   r   r   r   s        r   r   zCurveFp.__init__T   s    € ð ˆDŒHØˆDŒHØˆDŒHØˆD�Hr    c                 óü   — t        |t        «      rg| j                  }| j                  |j                  k(  xr@ | j                  |z  |j                  |z  k(  xr | j                  |z  |j                  |z  k(  S t
        S )a^  Return True if other is an identical curve, False otherwise.

        Note: the value of the cofactor of the curve is not taken into account
        when comparing curves, as it's derived from the base point and
        intrinsic curve characteristic (but it's complex to compute),
        only the prime and curve parameters are considered.
        )Ú
isinstancer   r   r   r   ÚNotImplemented©r   Úotherr   s      r   Ú__eq__zCurveFp.__eq__b   sn   € ô �eœWÔ%Ø—‘ˆAà—‘˜EŸI™IÑ%ò 2Ø—H‘H˜q‘L E§I¡I°¡MÑ1ò2à—H‘H˜q‘L E§I¡I°¡MÑ1ðô
 Ðr    c                 ó   — | |k(   S )z<Return False if other is an identical curve, True otherwise.© ©r   r&   s     r   Ú__ne__zCurveFp.__ne__s   ó   € à˜5‘=Ð Ð r    c                 óZ   — t        | j                  | j                  | j                  f«      S ©N)Úhashr   r   r   ©r   s    r   Ú__hash__zCurveFp.__hash__w   ó    € Ü�T—X‘X˜tŸx™x¨¯©Ð2Ó3Ð3r    c                 ó   — | j                   S r.   )r   r0   s    r   r   z	CurveFp.pz   ó   € Ø�x‰xˆr    c                 ó   — | j                   S r.   )r   r0   s    r   r   z	CurveFp.a}   r4   r    c                 ó   — | j                   S r.   )r   r0   s    r   r   z	CurveFp.b€   r4   r    c                 ó   — | j                   S r.   )r   r0   s    r   ÚcofactorzCurveFp.cofactorƒ   r4   r    c                 ór   — ||z  ||z  | j                   z   |z  | j                  z   z
  | j                  z  dk(  S )z!Is the point (x,y) on this curve?r   )r   r   r   ©r   ÚxÚys      r   Úcontains_pointzCurveFp.contains_point†   s:   € à�A‘˜!˜a™% $§(¡(Ñ*¨aÑ/°$·(±(Ñ:Ñ;¸t¿x¹xÑGÈ1ÑLÐLr    c                 óô   — | j                   �<dj                  | j                  | j                  | j                  | j                   «      S dj                  | j                  | j                  | j                  «      S )Nz#CurveFp(p={0}, a={1}, b={2}, h={3})zCurveFp(p={0}, a={1}, b={2}))r   Úformatr   r   r   r0   s    r   Ú__str__zCurveFp.__str__Š   se   € Ø�8‰8ÐØ8×?Ñ?Ø—‘Ø—‘Ø—‘Ø—‘ó	ð ð .×4Ñ4Ø�H‰HØ�H‰HØ�H‰Hó
ð 	
r    r.   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚGMPYr   r'   r+   r1   r   r   r   r8   r=   r@   r)   r    r   r   r   9   sD   „ ññ
 ô	ó$	òò"!ò4òòòòòMó
r    r   c                   ób   — e Zd ZdZerdd„Zndd„Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Zd„ Zy)Ú	CurveEdTwz/Parameters for a Twisted Edwards Elliptic CurveNc                 ó€   — t        |«      | _        t        |«      | _        t        |«      | _        || _        || _        y©z÷
            The curve of points satisfying a*x^2 + y^2 = 1 + d*x^2*y^2 (mod p).

            h is the cofactor of the curve.
            hash_func is the hash function associated with the curve
             (like SHA-512 for Ed25519)
            N)r   Ú_CurveEdTw__pÚ_CurveEdTw__aÚ_CurveEdTw__dÚ_CurveEdTw__hÚ_CurveEdTw__hash_func©r   r   r   Údr   Ú	hash_funcs         r   r   zCurveEdTw.__init__ž   s4   € ô ˜1“vˆDŒHÜ˜1“vˆDŒHÜ˜1“vˆDŒHØˆDŒHØ(ˆDÕr    c                 óJ   — || _         || _        || _        || _        || _        yrI   )rJ   rK   rL   rM   rN   rO   s         r   r   zCurveEdTw.__init__®   s(   € ð ˆDŒHØˆDŒHØˆDŒHØˆDŒHØ(ˆDÕr    c                 óü   — t        |t        «      rg| j                  }| j                  |j                  k(  xr@ | j                  |z  |j                  |z  k(  xr | j                  |z  |j                  |z  k(  S t
        S )z,Returns True if other is an identical curve.)r#   rG   rJ   rK   rL   r$   r%   s      r   r'   zCurveEdTw.__eq__¼   sl   € ä�eœYÔ'Ø—‘ˆAà—‘˜EŸI™IÑ%ò 2Ø—H‘H˜q‘L E§I¡I°¡MÑ1ò2à—H‘H˜q‘L E§I¡I°¡MÑ1ðô
 Ðr    c                 ó   — | |k(   S )z@Return False if the other is an identical curve, True otherwise.r)   r*   s     r   r+   zCurveEdTw.__ne__Ç   r,   r    c                 óZ   — t        | j                  | j                  | j                  f«      S r.   )r/   rJ   rK   rL   r0   s    r   r1   zCurveEdTw.__hash__Ë   r2   r    c                 óŠ   — | j                   |z  |z  ||z  z   dz
  | j                  |z  |z  |z  |z  z
  | j                  z  dk(  S )z"Is the point (x, y) on this curve?r   r   )rK   rL   rJ   r:   s      r   r=   zCurveEdTw.contains_pointÎ   sW   € ð �H‰H�q‰L˜1Ñ˜q 1™uÑ$ qÑ(¨4¯8©8°a©<¸!Ñ+;¸aÑ+?À!Ñ+CÑCØ�H‰Hñàñð 	r    c                 ó   — | j                   S r.   )rJ   r0   s    r   r   zCurveEdTw.pÔ   r4   r    c                 ó   — | j                   S r.   )rK   r0   s    r   r   zCurveEdTw.a×   r4   r    c                 ó   — | j                   S r.   )rL   r0   s    r   rP   zCurveEdTw.dÚ   r4   r    c                 ó$   — | j                  |«      S r.   )rN   )r   Údatas     r   rQ   zCurveEdTw.hash_funcÝ   s   € Ø×Ñ Ó%Ð%r    c                 ó   — | j                   S r.   )rM   r0   s    r   r8   zCurveEdTw.cofactorà   r4   r    c                 óô   — | j                   �<dj                  | j                  | j                  | j                  | j                   «      S dj                  | j                  | j                  | j                  «      S )Nz%CurveEdTw(p={0}, a={1}, d={2}, h={3})zCurveEdTw(p={0}, a={1}, d={2}))rM   r?   rJ   rK   rL   r0   s    r   r@   zCurveEdTw.__str__ã   se   € Ø�8‰8ÐØ:×AÑAØ—‘Ø—‘Ø—‘Ø—‘ó	ð ð 0×6Ñ6Ø�H‰HØ�H‰HØ�H‰Hó
ð 	
r    )NN)rA   rB   rC   rD   rE   r   r'   r+   r1   r=   r   r   rP   rQ   r8   r@   r)   r    r   rG   rG   ™   sD   „ Ù9áô	)ó 	)ò	ò!ò4òòòòò&òó
r    rG   c                   ó”   — e Zd ZdZed„ «       Zed„ «       Zed„ «       Zed„ «       Z	e	 dd„«       Z
d„ Zd	„ Zd
„ Zd„ Zdd„Zed„ «       Zy)ÚAbstractPointz2Class for common methods of elliptic curve points.c                 óÂ   — t        | «      |k(  sJ ‚| d|dz   }| |dz  d }t        |«      |dz  k(  sJ ‚t        |«      |dz  k(  sJ ‚t        |«      }t        |«      }||fS )zÄ
        Decode public point from :term:`raw encoding`.

        :term:`raw encoding` is the same as the :term:`uncompressed` encoding,
        but without the 0x04 byte at the beginning.
        Né   )Úlenr   )r[   Úraw_encoding_lengthÚxsÚysÚcoord_xÚcoord_ys         r   Ú_from_raw_encodingz AbstractPoint._from_raw_encodingõ   sŽ   € ô �4‹yÐ/Ò/Ð/Ð/ØÐ,Ð'¨1Ñ,Ð-ˆØÐ%¨Ñ*Ð,Ð-ˆô �2‹wÐ-°Ñ2Ò2Ð2Ð2Ü�2‹wÐ-°Ñ2Ò2Ð2Ð2Ü" 2Ó&ˆÜ" 2Ó&ˆà˜ÐÐr    c                 ó˜  — | dd dvrt        d«      ‚| dd dk(  }t        | dd «      }|j                  «       }t        |d|«      |j	                  «       |z  z   |j                  «       z   |z  }	 t        j                  ||«      }|t        |dz  «      k(  r	||z
  }||fS |}||fS # t        j                  $ r}t        d|«      ‚d}~ww xY w)z-Decode public point from compressed encoding.Nr   )ó   ó   z#Malformed compressed point encodingrj   é   ú0Encoding does not correspond to a point on curve)
r   r   r   Úpowr   r   r   Úsquare_root_mod_primeÚErrorÚbool)	r[   ÚcurveÚis_evenr;   r   ÚalphaÚbetaÚer<   s	            r   Ú_from_compressedzAbstractPoint._from_compressed
  sí   € ð ��ˆ8Ð-Ñ-Ü%Ð&KÓLÐLà�r˜�(˜gÑ%ˆÜ˜T ! "˜XÓ&ˆØ�G‰G‹IˆÜ�Q˜˜1“ §¡£¨Q¡Ñ/°%·'±'³)Ñ;¸qÑ@ˆð	Ü×5Ñ5°e¸QÓ?ˆDð
 ”d˜4 !™8“nÒ$Ø�D‘ˆAð �!ˆtˆð ˆAØ�!ˆtˆøô ×!Ñ!ò 	Ü%ØBÀAóð ûð	ús   Á/B% Â%C	Â8CÃC	c                 óš   — |dd dv sJ ‚| j                  |dd |«      \  }}|r%|dz  r|dd dk7  s|dz  s|dd dk7  rt        d«      ‚||fS )z)Decode public point from hybrid encoding.Nr   ©ó   ó   r{   rz   z"Inconsistent hybrid point encoding)rh   r   )Úclsr[   rc   Úvalidate_encodingr;   r<   s         r   Ú_from_hybridzAbstractPoint._from_hybrid   s|   € ð �B�QˆxÐ-Ñ-Ð-Ð-ð ×%Ñ% d¨1¨2 hÐ0CÓD‰ˆˆ1ñ Ø�ŠEØ�R�a�˜GÒ#Ø˜’EØ�R�a�˜GÒ#ä%Ð&JÓKÐKà�!ˆtˆr    c                 ó*  — t        |«      }|j                  «       }t        |«      dz   dz   dz  }t        |«      |k7  rt	        d«      ‚|d   dz  dz	  }|dxx   dz  cc<   t        |d«      }t        rt        |«      }||z  dz
  t        j                  |j                  «       |z  |z  |j                  «       z
  |«      z  |z  }	 t        j                  ||«      }|dz  |k7  r| |z  }||fS # t        j                  $ r}	t	        d	|	«      ‚d
}	~	ww xY w)z#Decode a point on an Edwards curve.r   é   é   z%Point length doesn't match the curve.éÿÿÿÿé€   é   Úlittlerm   Nra   )Ú	bytearrayr   r
   rb   r   r   rE   r   r   Úinverse_modrP   r   ro   rp   )
r|   rr   r[   r   Úexp_lenÚx_0r<   Úx2r;   rv   s
             r   Ú_from_edwardszAbstractPoint._from_edwards4  s,  € ô ˜‹ˆØ�G‰G‹Iˆä˜a“= 1Ñ$ qÑ(¨QÑ.ˆÜˆt‹9˜ÒÜ%Ð&MÓNÐNØ�B‰x˜$‰ 1Ñ$ˆàˆR‹�HÑ‹ä˜˜xÓ(ˆÝÜ�A“ˆAð �‰U�Q‰YÜ×&Ñ& u§w¡w£y°1¡}°qÑ'8¸5¿7¹7»9Ñ'DÀaÓHñIàñð 	ð	Ü×2Ñ2°2°qÓ9ˆAð ˆq‰5�CŠ<Ø��Q‘ˆAà�!ˆtˆøô ×!Ñ!ò 	Ü%ØBÀAóð ûð	ús   ÃC. Ã.DÄDÄDNc                 ó¸  — |st        g d¢«      }t        d„ |D «       «      st        d«      ‚t        |«      }t	        |t
        «      r| j                  ||«      S t        |«      }dt        |j                  «       «      z  }||k(  rd|v r| j                  ||«      \  }}||fS ||dz   k(  r`d|v sd|v rX|d	d d
v rd|v r| j                  |||«      \  }}||fS |d	d dk(  r d|v r| j                  |dd	 |«      \  }}||fS t        d«      ‚||dz  dz   k(  rd|v r| j                  ||«      \  }}||fS t        dj                  dj                  |«      «      «      ‚)a«  
        Initialise the object from byte encoding of a point.

        The method does accept and automatically detect the type of point
        encoding used. It supports the :term:`raw encoding`,
        :term:`uncompressed`, :term:`compressed`, and :term:`hybrid` encodings.

        Note: generally you will want to call the ``from_bytes()`` method of
        either a child class, PointJacobi or Point.

        :param data: single point encoding of the public key
        :type data: :term:`bytes-like object`
        :param curve: the curve on which the public key is expected to lay
        :type curve: ~ecdsa.ellipticcurve.CurveFp
        :param validate_encoding: whether to verify that the encoding of the
            point is self-consistent, defaults to True, has effect only
            on ``hybrid`` encoding
        :type validate_encoding: bool
        :param valid_encodings: list of acceptable point encoding formats,
            supported ones are: :term:`uncompressed`, :term:`compressed`,
            :term:`hybrid`, and :term:`raw encoding` (specified with ``raw``
            name). All formats by default (specified with ``None``).
        :type valid_encodings: :term:`set-like object`

        :raises `~ecdsa.errors.MalformedPointError`: if the public point does
            not lay on the curve or the encoding is invalid

        :return: x and y coordinates of the encoded point
        :rtype: tuple(int, int)
        ©ÚuncompressedÚ
compressedÚhybridÚrawc              3   ó6   K  — | ]  }|t        d «      v –— Œ y­w)r�   N)Úset)Ú.0Úis     r   Ú	<genexpr>z+AbstractPoint.from_bytes.<locals>.<genexpr>}  s#   è ø€ ð 
á$�ð ”ÐDÓEÔEÙ$ùs   ‚z@Only uncompressed, compressed, hybrid or raw encoding supported.ra   r‘   r   r�   rŽ   Nry   ó   z*Invalid X9.62 encoding of the public pointr�   z[Length of string does not match lengths of any of the enabled ({0}) encodings of the curve.z, )r“   ÚallÚ
ValueErrorr   r#   rG   r‹   rb   r   r   rh   r~   r   rw   r?   Újoin)	r|   rr   r[   r}   Úvalid_encodingsÚkey_lenrc   rf   rg   s	            r   Ú
from_byteszAbstractPoint.from_bytesW  sß  € ñD Ü!Ú?óˆOô ñ 
á$ó
ô 
ô ðóð ô ˜tÓ$ˆä�eœYÔ'Ø×$Ñ$ U¨DÓ1Ð1ä�d“)ˆØ¤(¨5¯7©7«9Ó"5Ñ5ÐØÐ)Ò)¨e°Ñ.FØ"×5Ñ5ØÐ)ó ÑˆG�Wð: ˜ÐÐð5 Ð+¨aÑ/Ò/Ø˜Ñ'¨>¸_Ñ+Là�B�QˆxÐ-Ñ-°(¸oÑ2MØ#&×#3Ñ#3ØÐ-Ð/@ó$Ñ �˜ð, ˜ÐÐð' �b�q�˜WÒ$¨¸?Ñ)JØ#&×#9Ñ#9Ø˜˜�HÐ1ó$Ñ �˜ð$ ˜ÐÐô *Ø@óð ð Ð*¨aÑ/°!Ñ3Ò3Ø Ñ/à"×3Ñ3°D¸%Ó@ÑˆG�Wð ˜ÐÐô &ðç™ §	¡	¨/Ó :Ó;óð r    c                 ó°   — | j                  «       j                  «       }t        | j                  «       |«      }t        | j	                  «       |«      }||z   S )z.Convert the point to the :term:`raw encoding`.©rr   r   r   r;   r<   )r   ÚprimeÚx_strÚy_strs       r   Ú_raw_encodezAbstractPoint._raw_encode¬  sB   € à—
‘
“—‘Ó ˆÜ  §¡£¨5Ó1ˆÜ  §¡£¨5Ó1ˆØ�u‰}Ðr    c                 ó¬   — | j                  «       j                  «       }t        | j                  «       |«      }| j	                  «       dz  rd|z   S d|z   S )z*Encode the point into the compressed form.r   rk   rj   rŸ   )r   r    r¡   s      r   Ú_compressed_encodez AbstractPoint._compressed_encode³  sG   € à—
‘
“—‘Ó ˆÜ  §¡£¨5Ó1ˆØ�6‰6‹8�aŠ<Ø˜U‘?Ð"Ø˜‰Ðr    c                 ó\   — | j                  «       }| j                  «       dz  rd|z   S d|z   S )z&Encode the point into the hybrid form.r   r{   rz   )r£   r<   )r   Úraw_encs     r   Ú_hybrid_encodezAbstractPoint._hybrid_encode»  s3   € à×"Ñ"Ó$ˆØ�6‰6‹8�aŠ<Ø˜WÑ$Ð$Ø˜Ñ Ð r    c                 ó  — | j                  «        | j                  «       | j                  «       | j                  «       j	                  «       }}}t        |«      dz   dz   dz  }t        ||d«      }|dz  r|dxx   dz  cc<   |S )z/Encode the point according to RFC8032 encoding.r   r€   r�   r…   ra   r‚   rƒ   )Úscaler;   r<   rr   r   r
   r	   )r   r;   r<   r   Úenc_lenr¢   s         r   Ú_edwards_encodezAbstractPoint._edwards_encodeÂ  ss   € à�
‰
ŒØ—&‘&“(˜DŸF™F›H d§j¡j£l§n¡nÓ&6ˆaˆ1ˆô ˜a“= 1Ñ$ qÑ(¨QÑ.ˆÜ˜Q ¨Ó2ˆØˆqŠ5Ø�"‹I˜Ñ‹IØˆr    c                 ó  — |dv sJ ‚| j                  «       }t        |t        «      r| j                  «       S |dk(  r| j	                  «       S |dk(  rd| j	                  «       z   S |dk(  r| j                  «       S | j                  «       S )a×  
        Convert the point to a byte string.

        The method by default uses the :term:`raw encoding` (specified
        by `encoding="raw"`. It can also output points in :term:`uncompressed`,
        :term:`compressed`, and :term:`hybrid` formats.

        For points on Edwards curves `encoding` is ignored and only the
        encoding defined in RFC 8032 is supported.

        :return: :term:`raw encoding` of a public on the curve
        :rtype: bytes
        )r‘   rŽ   r�   r�   r‘   rŽ   r—   r�   )rr   r#   rG   r¬   r£   r¨   r¥   )r   Úencodingrr   s      r   Úto_byteszAbstractPoint.to_bytesÎ  s�   € ð ÐJÑJÐJÐJØ—
‘
“ˆÜ�eœYÔ'Ø×'Ñ'Ó)Ð)Ø˜ÒØ×#Ñ#Ó%Ð%Ø˜Ò'Ø˜T×-Ñ-Ó/Ñ/Ð/Ø˜Ò!Ø×&Ñ&Ó(Ð(à×*Ñ*Ó,Ð,r    c                 ó–   — g }| rD| dz  r&| dz  }|dk\  r|dz  }|j                  |«       | |z  } n|j                  d«       | dz  } | rŒD|S )z&Calculate non-adjacent form of number.ra   é   r   )Úappend)ÚmultÚretÚnds      r   Ú_nafzAbstractPoint._nafé  s`   € ð ˆÙØ�aŠxØ˜A‘X�Ø˜’7Ø˜!‘G�BØ—
‘
˜2”Ø˜‘
‘à—
‘
˜1”Ø�Q‰JˆDò ð ˆ
r    )TN)r‘   )rA   rB   rC   rD   Ústaticmethodrh   rw   Úclassmethodr~   r‹   r�   r£   r¥   r¨   r¬   r¯   r¶   r)   r    r   r_   r_   ò   s›   „ Ù<àñ ó ð ð( ñó ðð* ñó ðð& ñ ó ð ðD àBFòR ó ðR òhòò!ò
ó-ð6 ñó ñr    r_   c                   óð   ‡ — e Zd ZdZdˆ fd„	Ze	 	 	 	 d ˆ f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d!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"ˆ xZ#S )"ÚPointJacobiuô   
    Point on a short Weierstrass elliptic curve. Uses Jacobi coordinates.

    In Jacobian coordinates, there are three parameters, X, Y and Z.
    They correspond to affine parameters 'x' and 'y' like so:

    x = X / ZÂ²
    y = Y / ZÂ³
    c                 óö   •— t         t        | �  «        || _        t        r:t        |«      t        |«      t        |«      f| _        |xr t        |«      | _        n|||f| _        || _        || _        g | _	        y)aF  
        Initialise a point that uses Jacobi representation internally.

        :param CurveFp curve: curve on which the point resides
        :param int x: the X parameter of Jacobi representation (equal to x when
          converting from affine coordinates
        :param int y: the Y parameter of Jacobi representation (equal to y when
          converting from affine coordinates
        :param int z: the Z parameter of Jacobi representation (equal to 1 when
          converting from affine coordinates
        :param int order: the point order, must be non zero when using
          generator=True
        :param bool generator: the point provided is a curve generator, as
          such, it will be commonly used with scalar multiplication. This will
          cause to precompute multiplication table generation for it
        N)
Úsuperrº   r   Ú_PointJacobi__curverE   r   Ú_PointJacobi__coordsÚ_PointJacobi__orderÚ_PointJacobi__generatorÚ_PointJacobi__precompute)r   rr   r;   r<   ÚzÚorderÚ	generatorÚ	__class__s          €r   r   zPointJacobi.__init__  sj   ø€ ô" 	Œk˜4Ñ)Ô+ØˆŒÝÜ  ›V¤S¨£V¬S°«VÐ4ˆDŒMØ Ò/¤S¨£ZˆD�Là  1˜IˆDŒMØ ˆDŒLØ$ˆÔØˆÕr    c                 óV   •— t         t        | �  ||||«      \  }}t        |||d||«      S )aP  
        Initialise the object from byte encoding of a point.

        The method does accept and automatically detect the type of point
        encoding used. It supports the :term:`raw encoding`,
        :term:`uncompressed`, :term:`compressed`, and :term:`hybrid` encodings.

        :param data: single point encoding of the public key
        :type data: :term:`bytes-like object`
        :param curve: the curve on which the public key is expected to lay
        :type curve: ~ecdsa.ellipticcurve.CurveFp
        :param validate_encoding: whether to verify that the encoding of the
            point is self-consistent, defaults to True, has effect only
            on ``hybrid`` encoding
        :type validate_encoding: bool
        :param valid_encodings: list of acceptable point encoding formats,
            supported ones are: :term:`uncompressed`, :term:`compressed`,
            :term:`hybrid`, and :term:`raw encoding` (specified with ``raw``
            name). All formats by default (specified with ``None``).
        :type valid_encodings: :term:`set-like object`
        :param int order: the point order, must be non zero when using
            generator=True
        :param bool generator: the point provided is a curve generator, as
            such, it will be commonly used with scalar multiplication. This
            will cause to precompute multiplication table generation for it

        :raises `~ecdsa.errors.MalformedPointError`: if the public point does
            not lay on the curve or the encoding is invalid

        :return: Point on curve
        :rtype: PointJacobi
        r   )r¼   rº   r�   ©
r|   rr   r[   r}   r›   rÃ   rÄ   rf   rg   rÅ   s
            €r   r�   zPointJacobi.from_bytes!  s=   ø€ ôT !¤¨cÑ=Ø�4Ð*¨Oó
Ñˆ�ô ˜5 '¨7°A°u¸iÓHÐHr    c                 óê  — | j                   r| j                  ry | j                  }|sJ ‚g }d}|dz  }| j                  \  }}}t	        | j
                  ||||«      }|dz  }|j                  |j                  «       |j                  «       f«       ||k  rX|dz  }|j                  «       j                  «       }|j                  |j                  «       |j                  «       f«       ||k  rŒX|| _        y )Nr   ra   )rÀ   rÁ   r¿   r¾   rº   r½   r²   r;   r<   Údoublerª   )r   rÃ   Ú
precomputer•   rf   rg   Úcoord_zÚdoublers           r   Ú_maybe_precomputezPointJacobi._maybe_precomputeP  sà   € Ø×Ò 4×#4Ò#4Øð —‘ˆÙˆˆuØˆ
ØˆØ�‰
ˆØ$(§M¡MÑ!ˆ�˜'Ü˜dŸl™l¨G°W¸gÀuÓMˆØ�‰
ˆØ×Ñ˜7Ÿ9™9›;¨¯	©	«Ð4Ô5à�%ŠiØ�‰FˆAØ—n‘nÓ&×,Ñ,Ó.ˆGØ×Ñ˜wŸy™y›{¨G¯I©I«KÐ8Ô9ð �%‹ið
 'ˆÕr    c                 ó:   — | j                   j                  «       }|S r.   )Ú__dict__Úcopy©r   Ústates     r   Ú__getstate__zPointJacobi.__getstate__j  s   € ð
 —‘×"Ñ"Ó$ˆØˆr    c                 ó:   — | j                   j                  |«       y r.   )rÏ   ÚupdaterÑ   s     r   Ú__setstate__zPointJacobi.__setstate__r  s   € Ø�‰×Ñ˜UÕ#r    c                 óÐ  — | j                   \  }}}|t        u r| S t        |t        «      r#|j	                  «       |j                  «       d}}}n't        |t        «      r|j                   \  }}}nt        S | j                  |j                  «       k7  ry| j                  j                  «       }||z  |z  }	||z  |z  }
||
z  ||	z  z
  |z  dk(  xr ||
z  |z  ||	z  |z  z
  |z  dk(  S )z}Compare for equality two points with each-other.

        Note: only points that lay on the same curve can be equal.
        r   Fr   )r¾   ÚINFINITYr#   ÚPointr;   r<   rº   r$   r½   rr   r   )r   r&   Úx1Úy1Úz1rŠ   Úy2Úz2r   Úzz1Úzz2s              r   r'   zPointJacobi.__eq__u  sñ   € ð
 —]‘]‰
ˆˆB�Ø”HÑØ�6ˆMÜ�eœUÔ#ØŸ™› E§G¡G£I¨q�B�‰BÜ˜œ{Ô+ØŸ™‰JˆB�‘Bä!Ð!Ø�<‰<˜5Ÿ;™;›=Ò(ØØ�L‰L�N‰NÓˆà�2‰g˜‰kˆØ�2‰g˜‰kˆð
 �S‘˜2 ™8Ñ# qÑ(¨AÑ-ò Ø�‰H�r‰M˜B ™H r™MÑ)Øñ3àñ3ð 	r    c                 ó   — | |k(   S ©z2Compare for inequality two points with each-other.r)   r*   s     r   r+   zPointJacobi.__ne__‘  r,   r    c                 ó   — | j                   S )zIReturn the order of the point.

        None if it is undefined.
        )r¿   r0   s    r   rÃ   zPointJacobi.order•  s   € ð
 �|‰|Ðr    c                 ó   — | j                   S )z-Return curve over which the point is defined.)r½   r0   s    r   rr   zPointJacobi.curveœ  ó   € à�|‰|Ðr    c                 ó¦   — | j                   \  }}}|dk(  r|S | j                  j                  «       }t        j                  ||«      }||dz  z  |z  S )aC  
        Return affine x coordinate.

        This method should be used only when the 'y' coordinate is not needed.
        It's computationally more efficient to use `to_affine()` and then
        call x() and y() on the returned instance. Or call `scale()`
        and then x() and y() on the returned instance.
        r   ra   ©r¾   r½   r   r   r‡   )r   r;   Ú_rÂ   r   s        r   r;   zPointJacobi.x   óS   € ð —-‘-‰ˆˆ1ˆaØ�Š6ØˆHØ�L‰L�N‰NÓˆÜ×$Ñ$ Q¨Ó*ˆØ�1�a‘4‰x˜!‰|Ðr    c                 ó¦   — | j                   \  }}}|dk(  r|S | j                  j                  «       }t        j                  ||«      }||dz  z  |z  S )aC  
        Return affine y coordinate.

        This method should be used only when the 'x' coordinate is not needed.
        It's computationally more efficient to use `to_affine()` and then
        call x() and y() on the returned instance. Or call `scale()`
        and then x() and y() on the returned instance.
        r   rl   rç   )r   rè   r<   rÂ   r   s        r   r<   zPointJacobi.y°  ré   r    c                 óÞ   — | j                   \  }}}|dk(  r| S | j                  j                  «       }t        j                  ||«      }||z  |z  }||z  |z  }||z  |z  |z  }||df| _         | S ©ze
        Return point scaled so that z == 1.

        Modifies point in place, returns self.
        r   rç   )r   r;   r<   rÂ   r   Úz_invÚzz_invs          r   rª   zPointJacobi.scaleÀ  sƒ   € ð —-‘-‰ˆˆ1ˆaØ�Š6ØˆKð �L‰L�N‰NÓˆÜ×(Ñ(¨¨AÓ.ˆØ˜‘ Ñ"ˆØ�‰J˜‰NˆØ�‰J˜Ñ Ñ"ˆØ˜A˜q˜	ˆŒØˆr    c                 óþ   — | j                   \  }}}| j                  j                  «       }||z  st        S | j	                  «        | j                   \  }}}|dk(  sJ ‚t        | j                  ||| j                  «      S )zReturn point in affine form.r   )r¾   r½   r   rØ   rª   rÙ   r¿   )r   rè   rÂ   r   r;   r<   s         r   Ú	to_affinezPointJacobi.to_affineÔ  si   € à—-‘-‰ˆˆ1ˆaØ�L‰L�N‰NÓˆØ�A’ÜˆOØ�
‰
ŒØ—-‘-‰ˆˆ1ˆaØ�AŠvˆˆvÜ�T—\‘\ 1 a¨¯©Ó6Ð6r    c                 ó’   — t        | j                  «       | j                  «       | j                  «       d| j	                  «       |«      S )a  Create from an affine point.

        :param bool generator: set to True to make the point to precalculate
          multiplication table - useful for public point when verifying many
          signatures (around 100 or so) or for generator points of a curve.
        r   )rº   rr   r;   r<   rÃ   )ÚpointrÄ   s     r   Úfrom_affinezPointJacobi.from_affineß  s6   € ô Ø�K‰K‹M˜5Ÿ7™7›9 e§g¡g£i°°E·K±K³MÀ9ó
ð 	
r    c                 óÈ   — ||z  |z  ||z  |z  }}|sy||z  |z  }d||z   dz  |z
  |z
  z  |z  }d|z  |z   }	|	|	z  d|z  z
  |z  }
|	||
z
  z  d|z  z
  |z  }d|z  |z  }|
||fS )z"Add a point to itself with z == 1.©r   r   r   ra   rl   r�   r)   )r   ÚX1ÚY1r   r   ÚXXÚYYÚYYYYÚSÚMÚTÚY3ÚZ3s                r   Ú_double_with_z_1zPointJacobi._double_with_z_1ö  s¨   € ð �b‘˜1‘˜b 2™g¨™kˆBˆÙØØ�B‰w˜‰{ˆØ�"�r‘'˜a‘ "Ñ$ tÑ+Ñ,¨qÑ0ˆØ�‰F�Q‰JˆØ�‰U�Q˜‘U‰]˜aÑˆà�1�q‘5‰k˜A ™HÑ$¨Ñ)ˆØ�‰V�a‰ZˆØ�"�bˆyÐr    c                 ó4  — |dk(  r| j                  ||||«      S |sy||z  |z  ||z  |z  }}|sy||z  |z  }||z  |z  }	d||z   dz  |z
  |z
  z  |z  }
d|z  ||	z  |	z  z   |z  }||z  d|
z  z
  |z  }||
|z
  z  d|z  z
  |z  }||z   dz  |z
  |	z
  |z  }|||fS )z#Add a point to itself, arbitrary z.r   rõ   ra   rl   r�   )r   )r   rö   r÷   ÚZ1r   r   rø   rù   rú   ÚZZrû   rü   rý   rþ   rÿ   s                  r   Ú_doublezPointJacobi._double  sö   € à�Š7Ø×(Ñ(¨¨R°°AÓ6Ð6ÙØð �b‘˜1‘˜b 2™g¨™kˆBˆÙØØ�B‰w˜‰{ˆØ�"‰W�q‰[ˆØ�"�r‘'˜a‘ "Ñ$ tÑ+Ñ,¨qÑ0ˆØ�‰V�a˜"‘f˜r‘kÑ! QÑ&ˆØ�‰U�Q˜‘U‰]˜aÑˆà�1�q‘5‰k˜A ™HÑ$¨Ñ)ˆØ�B‰w˜1‰n˜rÑ! BÑ&¨!Ñ+ˆà�"�bˆyÐr    c                 ó"  — | j                   \  }}}|st        S | j                  j                  «       | j                  j	                  «       }}| j                  |||||«      \  }}}|st        S t        | j                  |||| j                  «      S )zAdd a point to itself.)r¾   rØ   r½   r   r   r  rº   r¿   )	r   rö   r÷   r  r   r   ÚX3rþ   rÿ   s	            r   rÉ   zPointJacobi.double  sw   € à—]‘]‰
ˆˆB�áÜˆOà�|‰|�~‰~Ó §¡§¡Ó!1ˆ1ˆà—\‘\ " b¨"¨a°Ó3‰
ˆˆB�áÜˆOÜ˜4Ÿ<™<¨¨R°°T·\±\ÓBÐBr    c                 ó  — ||z
  }||z  }d|z  |z  }||z  }	d||z
  z  }
|s.|
s,| j                  |||| j                  j                  «       «      S ||z  }|
dz  |	z
  d|z  z
  |z  }|
||z
  z  d|z  |	z  z
  |z  }d|z  |z  }|||fS )z&add points when both Z1 and Z2 equal 1r±   ra   ©r   r½   r   )r   rö   r÷   ÚX2ÚY2r   ÚHÚHHÚIÚJÚrÚVr  rþ   rÿ   s                  r   Ú_add_with_z_1zPointJacobi._add_with_z_1+  s¼   € ð �‰GˆØ�‰UˆØ�‰F�Q‰JˆØ�‰EˆØ��b‘‰MˆÙ™Ø×(Ñ(¨¨R°°D·L±L·N±NÓ4DÓEÐEØ�‰FˆØ�‰d�Q‰h˜˜Q™Ñ !Ñ#ˆØ�1�r‘6‰l˜Q ™V a™ZÑ'¨1Ñ,ˆØ�‰U�Q‰YˆØ�2�rˆzÐr    c                 ó  — ||z
  dz  |z  }||z  |z  }||z  }	||z
  dz  |z  }
|s/|
s-| j                  ||||| j                  j                  «       «      S |
|z
  |	z
  |z  }||z
  ||z
  z  ||	|z
  z  z
  |z  }|||z
  z  |z  }|||fS )zadd points when Z1 == Z2ra   ©r  r½   r   )r   rö   r÷   r  r	  r
  r   ÚAÚBÚCÚDr  rþ   rÿ   s                 r   Ú_add_with_z_eqzPointJacobi._add_with_z_eq<  s¸   € ð �"‰W˜‰N˜QÑˆØ�‰F�Q‰JˆØ�‰FˆØ�"‰W˜‰N˜QÑˆÙ™Ø—<‘<  B¨¨A¨t¯|©|¯~©~Ó/?Ó@Ð@Ø�!‰e�a‰i˜1‰_ˆØ�B‰w˜1˜r™6Ñ" R¨1¨q©5¡\Ñ1°QÑ6ˆØ�2˜‘7‰^˜aÑˆØ�2�rˆzÐr    c                 óh  — ||z  |z  }||z  |z  ||z  |z  |z  }	}||z
  |z  }
|
|
z  |z  }d|z  |z  }|
|z  }d|	|z
  z  |z  }|s.|
s,| j                  |||| j                  j                  «       «      S ||z  }||z  |z
  d|z  z
  |z  }|||z
  z  d|z  |z  z
  |z  }||
z   dz  |z
  |z
  |z  }|||fS )zadd points when Z2 == 1r±   ra   r  )r   rö   r÷   r  r	  r
  r   ÚZ1Z1ÚU2ÚS2r  r  r  r  r  r  r  rþ   rÿ   s                      r   Ú_add_with_z2_1zPointJacobi._add_with_z2_1K  s  € ð �B‰w˜‰{ˆØ�d‘˜Q‘  R¡¨$¡°Ñ 2ˆBˆØ�"‰W˜‰MˆØ�‰U�Q‰YˆØ�‰F�Q‰JˆØ�‰EˆØ��b‘‰M˜AÑˆÙ™Ø×(Ñ(¨¨R°°D·L±L·N±NÓ4DÓEÐEØ�‰FˆØ�!‰e�a‰i˜!˜a™%Ñ 1Ñ$ˆØ�1�r‘6‰l˜Q ™V a™ZÑ'¨1Ñ,ˆØ�A‰v˜!‰m˜dÑ" RÑ'¨1Ñ,ˆØ�2�rˆzÐr    c                 óœ  — ||z  |z  }||z  |z  }	||	z  |z  }
||z  |z  }||z  |	z  |z  }||z  |z  |z  }||
z
  }d|z  |z  |z  }||z  |z  }d||z
  z  |z  }|s/|s-| j                  ||||| j                  j                  «       «      S |
|z  }||z  |z
  d|z  z
  |z  }|||z
  z  d|z  |z  z
  |z  }||z   dz  |z
  |	z
  |z  |z  }|||fS )zadd points with arbitrary zr±   ra   r  )r   rö   r÷   r  r	  r
  ÚZ2r   r  ÚZ2Z2ÚU1r  ÚS1r  r  r  r  r  r  r  rþ   rÿ   s                         r   Ú_add_with_z_nezPointJacobi._add_with_z_ne^  s,  € ð �B‰w˜‰{ˆØ�B‰w˜‰{ˆØ�$‰Y˜‰]ˆØ�$‰Y˜‰]ˆØ�"‰W�t‰^˜aÑˆØ�"‰W�t‰^˜aÑˆØ�‰GˆØ�‰E�A‰I˜‰MˆØ�‰E�A‰IˆØ��b‘‰M˜AÑˆÙ™Ø—<‘<  B¨¨A¨t¯|©|¯~©~Ó/?Ó@Ð@Ø�‰FˆØ�!‰e�a‰i˜!˜a™%Ñ 1Ñ$ˆØ�1�r‘6‰l˜Q ™V a™ZÑ'¨1Ñ,ˆØ�B‰w˜1‰n˜tÑ# dÑ*¨aÑ/°!Ñ3ˆà�2�rˆzÐr    c                 ó   — | |z   S ©zAdd other to self.r)   r*   s     r   Ú__radd__zPointJacobi.__radd__u  ó   € à�e‰|Ðr    c           	      óF  — |s||z  ||z  ||z  fS |s||z  ||z  ||z  fS ||k(  r0|dk(  r| j                  |||||«      S | j                  ||||||«      S |dk(  r| j                  ||||||«      S |dk(  r| j                  ||||||«      S | j                  |||||||«      S )z&add two points, select fastest method.r   )r  r  r  r#  )r   rö   r÷   r  r	  r
  r  r   s           r   Ú_addzPointJacobi._addy  sÝ   € áØ˜‘6˜2 ™6 2¨¡6Ð)Ð)ÙØ˜‘6˜2 ™6 2¨¡6Ð)Ð)Ø�Š8Ø�QŠwØ×)Ñ)¨"¨b°"°b¸!Ó<Ð<Ø×&Ñ& r¨2¨r°2°r¸1Ó=Ð=Ø�Š7Ø×&Ñ& r¨2¨r°2°r¸1Ó=Ð=Ø�Š7Ø×&Ñ& r¨2¨r°2°r¸1Ó=Ð=Ø×"Ñ" 2 r¨2¨r°2°r¸1Ó=Ð=r    c           	      óÀ  — | t         k(  r|S |t         k(  r| S t        |t        «      rt        j	                  |«      }| j
                  |j
                  k7  rt        d«      ‚| j
                  j                  «       }| j                  \  }}}|j                  \  }}}| j                  |||||||«      \  }	}
}|st         S t        | j
                  |	|
|| j                  «      S )z!Add two points on elliptic curve.z%The other point is on different curve)rØ   r#   rÙ   rº   ró   r½   r™   r   r¾   r)  r¿   )r   r&   r   rö   r÷   r  r	  r
  r  r  rþ   rÿ   s               r   Ú__add__zPointJacobi.__add__‰  sÃ   € à”8ÒØˆLØ”HÒØˆKÜ�eœUÔ#Ü×+Ñ+¨EÓ2ˆEØ�<‰<˜5Ÿ=™=Ò(ÜÐDÓEÐEà�L‰L�N‰NÓˆØ—]‘]‰
ˆˆB�Ø—^‘^‰
ˆˆB�à—Y‘Y˜r 2 r¨2¨r°2°qÓ9‰
ˆˆB�áÜˆOÜ˜4Ÿ<™<¨¨R°°T·\±\ÓBÐBr    c                 ó   — | |z  S ©úMultiply point by an integer.r)   r*   s     r   Ú__rmul__zPointJacobi.__rmul__ž  r'  r    c           
      óp  — ddd| j                   j                  «       f\  }}}}| j                  }| j                  D ]N  \  }}|dz  r?|dz  dk\  r|dz   dz  } |||||| d|«      \  }}}Œ/|dz
  dz  } ||||||d|«      \  }}}ŒJ|dz  }ŒP |st        S t        | j                   |||| j                  «      S )ú4Multiply point by integer with precomputation table.r   ra   r±   r   )r½   r   r)  rÁ   rØ   rº   r¿   )	r   r&   r  rþ   rÿ   r   r)  r	  r
  s	            r   Ú_mul_precomputezPointJacobi._mul_precompute¢  sÖ   € à˜1˜a §¡§¡Ó!1Ð1‰ˆˆB��AØ�y‰yˆØ×'Ô'‰FˆB�Ø�qŠyØ˜1‘9 ’>Ø" Q™Y¨1Ñ,�EÙ!% b¨"¨b°"°r°c¸1¸aÓ!@‘J�B˜™Bà" Q™Y¨1Ñ,�EÙ!% b¨"¨b°"°b¸!¸QÓ!?‘J�B˜™Bà˜!‘‘ð (ñ ÜˆOÜ˜4Ÿ<™<¨¨R°°T·\±\ÓBÐBr    c           
      óÎ  — | j                   d   r|st        S |dk(  r| S | j                  r|| j                  dz  z  }| j                  «        | j                  r| j                  |«      S | j                  «       } | j                   \  }}}d\  }}}| j                  j                  «       | j                  j                  «       }	}| j                  }
| j                  }t        | j                  |«      «      D ]C  } |
|||||	«      \  }}}|dk  r |||||| d|«      \  }}}Œ,|dkD  sŒ2 ||||||d|«      \  }}}ŒE |st        S t        | j                  |||| j                  «      S )r.  r   ra   rõ   r   )r¾   rØ   r¿   rÍ   rÁ   r2  rª   r½   r   r   r  r)  Úreversedr¶   rº   )r   r&   r	  r
  rè   r  rþ   rÿ   r   r   r  r)  r•   s                r   Ú__mul__zPointJacobi.__mul__µ  sV  € à�}‰}˜QÒ¡uÜˆOØ�AŠ:ØˆKØ�<Š<à˜TŸ\™\¨AÑ-Ñ.ˆEØ×ÑÔ Ø×ÒØ×'Ñ'¨Ó.Ð.à�z‰z‹|ˆØ—M‘M‰	ˆˆB�Ø‰
ˆˆB�Ø�|‰|�~‰~Ó §¡§¡Ó!1ˆ1ˆØ—,‘,ˆØ�y‰yˆô ˜$Ÿ)™) EÓ*Ö+ˆAÙ   R¨¨Q°Ó2‰JˆB��BØ�1ŠuÙ! " b¨"¨b°2°#°q¸!Ó<‘
��B™Ø�Q“Ù! " b¨"¨b°"°a¸Ó;‘
��B™ð ,ñ ÜˆOä˜4Ÿ<™<¨¨R°°T·\±\ÓBÐBr    c           
      óè  — |t         k(  s|dk(  r| |z  S |dk(  r||z  S t        |t        «      st        j                  |«      }| j	                  «        |j	                  «        | j
                  r|j
                  r| |z  ||z  z   S | j                  r|| j                  z  }|| j                  z  }d\  }}}| j                  j                  «       | j                  j                  «       }}| j                  «        | j                  \  }	}
}|j                  «        |j                  \  }}}| j                  }| j                  } ||	|
 ||| ||«      \  }}} ||	|
||| ||«      \  }}}|| |}}}|| |}}}|s| |z  ||z  z   S t        t        | j!                  t#        |«      «      «      «      }t        t        | j!                  t#        |«      «      «      «      }t%        |«      t%        |«      k  rdgt%        |«      t%        |«      z
  z  |z   }n5t%        |«      t%        |«      kD  rdgt%        |«      t%        |«      z
  z  |z   }t'        ||«      D ]ó  \  }}  ||||||«      \  }}}|dk(  r9| dk(  rŒ!| dk  r |||||| ||«      \  }}}Œ:| dkD  sJ ‚ ||||||||«      \  }}}ŒT|dk  rK| dk(  r |||||	|
 ||«      \  }}}Œr| dk  r ||||||||«      \  }}}ŒŠ| dkD  sJ ‚ ||||||||«      \  }}}Œ¤|dkD  sJ ‚| dk(  r |||||	|
||«      \  }}}ŒÃ| dk  r ||||||||«      \  }}}ŒÛ| dkD  sJ ‚ ||||||||«      \  }}}Œõ |st         S t        | j                  |||| j                  «      S )z{
        Do two multiplications at the same time, add results.

        calculates self*self_mul + other*other_mul
        r   rõ   )rØ   r#   rº   ró   rÍ   rÁ   r¿   r½   r   r   rª   r¾   r  r)  Úlistr4  r¶   Úintrb   Úzip)!r   Úself_mulr&   Ú	other_mulr  rþ   rÿ   r   r   rö   r÷   r  r	  r
  r  r  r)  ÚmAmB_XÚmAmB_YÚmAmB_ZÚpAmB_XÚpAmB_YÚpAmB_ZÚmApB_XÚmApB_YÚmApB_ZÚpApB_XÚpApB_YÚpApB_ZÚself_nafÚ	other_nafr  r  s!                                    r   Úmul_addzPointJacobi.mul_addÖ  sÊ  € ð ”HÒ 	¨Q¢Ø˜(‘?Ð"Ø�qŠ=Ø˜9Ñ$Ð$Ü˜%¤Ô-Ü×+Ñ+¨EÓ2ˆEð 	×ÑÔ Ø×ÑÔ!Ø×Ò ×!3Ò!3Ø˜(‘? U¨YÑ%6Ñ6Ð6à�<Š<Ø $§,¡,Ñ.ˆHØ! D§L¡LÑ0ˆIð ‰
ˆˆB�Ø�|‰|�~‰~Ó §¡§¡Ó!1ˆ1ˆð 	�
‰
ŒØ—]‘]‰
ˆˆB�Ø�‰ŒØ—^‘^‰
ˆˆB�à—,‘,ˆØ�y‰yˆñ "& b¨2¨#¨r°2¸°s¸BÀÓ!BÑˆ�˜Ù!% b¨"¨b°"°r°c¸2¸qÓ!AÑˆ�˜Ø!'¨&¨°&˜�ˆØ!'¨&¨°&˜�ˆñ Ø˜(‘? U¨YÑ%6Ñ6Ð6ô
 œ §¡¬3¨x«=Ó!9Ó:Ó;ˆÜœ $§)¡)¬C°	«NÓ";Ó<Ó=ˆ	ô ˆx‹=œ3˜y›>Ò)Ø�sœc )›n¬s°8«}Ñ<Ñ=ÀÑH‰HÜ�‹]œS ›^Ò+Ø˜œs 8›}¬s°9«~Ñ=Ñ>ÀÑJˆIä˜ )Ö,‰DˆAˆqÙ   R¨¨Q°Ó2‰JˆB��Bð �AŠvØ˜’6ØØ˜’UÙ!% b¨"¨b°"°r°c¸2¸qÓ!A‘J�B˜™Bà˜qš5�L˜5Ù!% b¨"¨b°"°b¸"¸aÓ!@‘J�B˜™BØ�Q’Ø˜’6Ù!% b¨"¨b°"°r°c¸2¸qÓ!A‘J�B˜™BØ˜’UÙ!% b¨"¨b°&¸&À&È!Ó!L‘J�B˜™Bà˜qš5�L˜5Ù!% b¨"¨b°&¸&À&È!Ó!L‘J�B˜™Bà˜1’u��uØ˜’6Ù!% b¨"¨b°"°b¸"¸aÓ!@‘J�B˜™BØ˜’UÙ!% b¨"¨b°&¸&À&È!Ó!L‘J�B˜™Bà˜qš5�L˜5Ù!% b¨"¨b°&¸&À&È!Ó!L‘J�B˜™Bð9 -ñ< ÜˆOä˜4Ÿ<™<¨¨R°°T·\±\ÓBÐBr    c                 ój   — | j                   \  }}}t        | j                  || || j                  «      S )zReturn negated point.)r¾   rº   r½   r¿   )r   r;   r<   rÂ   s       r   Ú__neg__zPointJacobi.__neg__8  s.   € à—-‘-‰ˆˆ1ˆaÜ˜4Ÿ<™<¨¨Q¨B°°4·<±<Ó@Ð@r    ©NF)TNNF)F)$rA   rB   rC   rD   r   r¸   r�   rÍ   rÓ   rÖ   r'   r+   rÃ   rr   r;   r<   rª   rð   r·   ró   r   r  rÉ   r  r  r  r#  r&  r)  r+  r/  r2  r5  rJ  rL  Ú__classcell__©rÅ   s   @r   rº   rº   ú  sÑ   ø„ ñõð8 ð
 ØØØô,Ió ð,Iò\'ò4ò$òò8!òòòò ò ò(	7ð ò	
ó ð	
ò,ò ò,Còò"òò&ò.ò>ò Cò*òCò&CòB`CöDAr    rº   c                   óˆ   ‡ — e Zd ZdZdˆ fd„	Ze	 	 	 dˆ f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ˆ xZS )rÙ   z‚A point on a short Weierstrass elliptic curve. Altering x and y is
    forbidden, but they can be read by the x() and y() methods.c                 óŒ  •— t         t        | �  «        || _        t        r=|xr t        |«      | _        |xr t        |«      | _        |xr t        |«      | _        n|| _        || _        || _        | j                  r| j                  j                  ||«      sJ ‚|r&|j                  «       dk7  r|r| |z  t        k(  sJ ‚yyyy)z@curve, x, y, order; order (optional) is the order of this point.r   N)r¼   rÙ   r   Ú_Point__curverE   r   Ú	_Point__xÚ	_Point__yÚ_Point__orderr=   r8   rØ   )r   rr   r;   r<   rÃ   rÅ   s        €r   r   zPoint.__init__B  s¯   ø€ äŒe�TÑ#Ô%ØˆŒÝØ’|œS ›VˆDŒHØ’|œS ›VˆDŒHØ Ò/¤S¨£ZˆD�LàˆDŒHØˆDŒHØ ˆDŒLà�<Š<Ø—<‘<×.Ñ.¨q°!Ô4Ð4Ð4ñ �U—^‘^Ó%¨Ò*©uØ˜%‘<¤8Ò+Ð+Ñ+ð 05Ð*ˆ5r    c                 óR   •— t         t        | �  ||||«      \  }}t        ||||«      S )ag  
        Initialise the object from byte encoding of a point.

        The method does accept and automatically detect the type of point
        encoding used. It supports the :term:`raw encoding`,
        :term:`uncompressed`, :term:`compressed`, and :term:`hybrid` encodings.

        :param data: single point encoding of the public key
        :type data: :term:`bytes-like object`
        :param curve: the curve on which the public key is expected to lay
        :type curve: ~ecdsa.ellipticcurve.CurveFp
        :param validate_encoding: whether to verify that the encoding of the
            point is self-consistent, defaults to True, has effect only
            on ``hybrid`` encoding
        :type validate_encoding: bool
        :param valid_encodings: list of acceptable point encoding formats,
            supported ones are: :term:`uncompressed`, :term:`compressed`,
            :term:`hybrid`, and :term:`raw encoding` (specified with ``raw``
            name). All formats by default (specified with ``None``).
        :type valid_encodings: :term:`set-like object`
        :param int order: the point order, must be non zero when using
            generator=True

        :raises `~ecdsa.errors.MalformedPointError`: if the public point does
            not lay on the curve or the encoding is invalid

        :return: Point on curve
        :rtype: Point
        )r¼   rÙ   r�   )	r|   rr   r[   r}   r›   rÃ   rf   rg   rÅ   s	           €r   r�   zPoint.from_bytesW  s9   ø€ ôL !¤¨Ñ7Ø�4Ð*¨Oó
Ñˆ�ô �U˜G W¨eÓ4Ð4r    c                 ó  — |t         u r| j                  du xs | j                  du S t        |t        «      rO| j
                  |j
                  k(  xr4 | j                  |j                  k(  xr | j                  |j                  k(  S t        S )z†Return True if the points are identical, False otherwise.

        Note: only points that lay on the same curve can be equal.
        N)rØ   rS  rT  r#   rÙ   rR  r$   r*   s     r   r'   zPoint.__eq__‚  sz   € ð
 ”HÑØ—8‘8˜tÐ#Ò7 t§x¡x°4Ð'7Ð7Ü�eœUÔ#à—‘ §¡Ñ-ò *Ø—H‘H §	¡	Ñ)ò*à—H‘H §	¡	Ñ)ðô
 Ðr    c                 ó   — | |k(   S )z6Returns False if points are identical, True otherwise.r)   r*   s     r   r+   zPoint.__ne__‘  r,   r    c                 óŽ   — t        | j                  | j                  | j                  j                  «       | j                  z
  «      S r.   )rÙ   rR  rS  r   rT  r0   s    r   rL  zPoint.__neg__•  s-   € Ü�T—\‘\ 4§8¡8¨T¯\©\¯^©^Ó-=ÀÇÁÑ-HÓIÐIr    c                 óÚ  — t        |t        «      st        S |t        k(  r| S | t        k(  r|S | j                  |j                  k(  sJ ‚| j
                  |j
                  k(  rM| j                  |j                  z   | j                  j                  «       z  dk(  rt        S | j                  «       S | j                  j                  «       }|j                  | j                  z
  t        j                  |j
                  | j
                  z
  |«      z  |z  }||z  | j
                  z
  |j
                  z
  |z  }|| j
                  |z
  z  | j                  z
  |z  }t        | j                  ||«      S )zAdd one point to another point.r   )r#   rÙ   r$   rØ   rR  rS  rT  r   rÉ   r   r‡   )r   r&   r   ÚlÚx3Úy3s         r   r+  zPoint.__add__˜  s.  € ô
 ˜%¤Ô'Ü!Ð!Ø”HÒØˆKØ”8ÒØˆLØ�|‰|˜uŸ}™}Ò,Ð,Ð,Ø�8‰8�u—y‘yÒ Ø—‘˜5Ÿ9™9Ñ$¨¯©¯©Ó(8Ñ8¸AÒ=Ü�à—{‘{“}Ð$à�L‰L�N‰NÓˆð �Y‰Y˜Ÿ™Ñ!Ü×&Ñ& u§y¡y°4·8±8Ñ';¸QÓ?ñ@àñˆð
 �!‰e�d—h‘hÑ §¡Ñ*¨aÑ/ˆØ�4—8‘8˜b‘=Ñ! D§H¡HÑ,°Ñ1ˆä�T—\‘\ 2 rÓ*Ð*r    c                 óô  — d„ }|}|dk(  s| j                   r|| j                   z  dk(  rt        S | t        k(  rt        S |dk  r|  | z  S d|z  }t        | j                  | j                  | j
                   | j                  j                  «       z  | j                   «      } ||«      dz  }| }|dkD  rE|j                  «       }||z  dk7  r||z  dk(  r|| z   }||z  dk(  r||z  dk7  r||z   }|dz  }|dkD  rŒE|S )úMultiply a point by an integer.c                 ó>   — | dkD  sJ ‚d}|| k  rd|z  }|| k  rŒ|dz  S )Nr   r   ra   r)   )r;   Úresults     r   Úleftmost_bitz#Point.__mul__.<locals>.leftmost_bit¹  s5   € Ø�q’5ˆL�5ØˆFØ˜A’+Ø˜V™�ð ˜A“+à˜Q‘;Ðr    r   rl   ra   r   )rU  rØ   rÙ   rR  rS  rT  r   rÉ   )r   r&   rb  rv   Úe3Únegative_selfr•   ra  s           r   r5  zPoint.__mul__¶  s  € ò	ð ˆØ�Š6�d—l’l q¨4¯<©<Ñ'7¸1Ò'<ÜˆOØ”8ÒÜˆOØˆqŠ5Ø�E˜q˜b‘>Ð!ð �‰UˆÜØ�L‰LØ�H‰HØ�h‰hˆY˜$Ÿ,™,Ÿ.™.Ó*Ñ*Ø�L‰Ló	
ˆñ ˜Ó Ñ!ˆØˆà�!ŠeØ—]‘]“_ˆFØ�Q‘˜1Š} ! a¡%¨A¢Ø $™�Ø�Q‘˜1Š} ! a¡%¨A¢Ø -Ñ/�à�Q‘ˆAð �!‹eð ˆr    c                 ó   — | |z  S )r_  r)   r*   s     r   r/  zPoint.__rmul__ß  s   € ð �e‰|Ðr    c                 óL   — | t         k(  ryd| j                  | j                  fz  S )NÚinfinityz(%d,%d))rØ   rS  rT  r0   s    r   r@   zPoint.__str__ä  s%   € Ø”8ÒØØ˜DŸH™H d§h¡hÐ/Ñ/Ð/r    c                 óÆ  — | t         k(  rt         S | j                  j                  «       }| j                  j                  «       }d| j                  z  | j                  z  |z   t        j                  d| j                  z  |«      z  |z  }|st         S ||z  d| j                  z  z
  |z  }|| j                  |z
  z  | j                  z
  |z  }t        | j                  ||«      S )z)Return a new point that is twice the old.rl   ra   )	rØ   rR  r   r   rS  r   r‡   rT  rÙ   )r   r   r   r[  r\  r]  s         r   rÉ   zPoint.doubleé  sË   € à”8ÒÜˆOð �L‰L�N‰NÓˆØ�L‰L�N‰NÓˆð �—‘‰\˜DŸH™HÑ$ qÑ(Ü×&Ñ& q¨4¯8©8¡|°QÓ7ñ8àñˆñ
 ÜˆOà�!‰e�a˜$Ÿ(™(‘lÑ" aÑ'ˆØ�4—8‘8˜b‘=Ñ! D§H¡HÑ,°Ñ1ˆä�T—\‘\ 2 rÓ*Ð*r    c                 ó   — | j                   S r.   )rS  r0   s    r   r;   zPoint.x   r4   r    c                 ó   — | j                   S r.   )rT  r0   s    r   r<   zPoint.y  r4   r    c                 ó   — | j                   S r.   )rR  r0   s    r   rr   zPoint.curve  ó   € Ø�|‰|Ðr    c                 ó   — | j                   S r.   )rU  r0   s    r   rÃ   zPoint.order	  rl  r    r.   )TNN)rA   rB   rC   rD   r   r¸   r�   r'   r+   rL  r+  r5  r/  r@   rÉ   r;   r<   rr   rÃ   rN  rO  s   @r   rÙ   rÙ   >  sl   ø„ ñCõ,ð* ð
 ØØô(5ó ð(5òTò!òJò+ò<'òRò
0ò
+ò.òòör    rÙ   c                   ó¢   ‡ — e Zd ZdZdˆ fd„	Ze	 	 	 	 dˆ f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ˆ xZS )ÚPointEdwardszêPoint on Twisted Edwards curve.

    Internally represents the coordinates on the curve using four parameters,
    X, Y, Z, T. They correspond to affine parameters 'x' and 'y' like so:

    x = X / Z
    y = Y / Z
    x*y = T / Z
    c                 ó  •— t         t        | �  «        || _        t        rDt        |«      t        |«      t        |«      t        |«      f| _        |xr t        |«      | _        n||||f| _        || _        || _        g | _	        y)zS
        Initialise a point that uses the extended coordinates internally.
        N)
r¼   ro  r   Ú_PointEdwards__curverE   r   Ú_PointEdwards__coordsÚ_PointEdwards__orderÚ_PointEdwards__generatorÚ_PointEdwards__precompute)	r   rr   r;   r<   rÂ   ÚtrÃ   rÄ   rÅ   s	           €r   r   zPointEdwards.__init__  sr   ø€ ô 	Œl˜DÑ*Ô,ØˆŒÝÜ  ›V¤S¨£V¬S°«V´S¸³VÐ<ˆDŒMØ Ò/¤S¨£ZˆD�Là  1 a˜LˆDŒMØ ˆDŒLØ$ˆÔØˆÕr    c           	      ó^   •— t         t        | �  ||||«      \  }}t        |||d||z  ||«      S )aŠ  
        Initialise the object from byte encoding of a point.

        `validate_encoding` and `valid_encodings` are provided for
        compatibility with Weierstrass curves, they are ignored for Edwards
        points.

        :param data: single point encoding of the public key
        :type data: :term:`bytes-like object`
        :param curve: the curve on which the public key is expected to lay
        :type curve: ecdsa.ellipticcurve.CurveEdTw
        :param None validate_encoding: Ignored, encoding is always validated
        :param None valid_encodings: Ignored, there is just one encoding
            supported
        :param int order: the point order, must be non zero when using
            generator=True
        :param bool generator: Flag to mark the point as a curve generator,
            this will cause the library to pre-compute some values to
            make repeated usages of the point much faster

        :raises `~ecdsa.errors.MalformedPointError`: if the public point does
            not lay on the curve or the encoding is invalid

        :return: Initialised point on an Edwards curve
        :rtype: PointEdwards
        r   )r¼   ro  r�   rÇ   s
            €r   r�   zPointEdwards.from_bytes'  sI   ø€ ôH !¤¨sÑ>Ø�4Ð*¨Oó
Ñˆ�ô Ø�7˜G Q¨°'Ñ(9¸5À)ó
ð 	
r    c                 ó  — | j                   r| j                  r| j                  S | j                  }|sJ ‚g }d}|dz  }| j                  \  }}}}| j                  j                  «       }t        | j                  |||||«      }	|dz  }||k  rg|	j                  «       }	|	j                  «       |	j                  «       }}||z  |z  }|j                  |||f«       |dz  }|	j                  «       }	||k  rŒg|| _        | j                  S )Nr   ra   r±   )rt  ru  rs  rr  rq  r   ro  rª   r;   r<   r²   rÉ   )
r   rÃ   rÊ   r•   rf   rg   rË   Úcoord_tr    rÌ   s
             r   rÍ   zPointEdwards._maybe_precomputeR  s  € Ø×Ò 4×#4Ò#4Ø×$Ñ$Ð$ð —‘ˆÙˆˆuØˆ
ØˆØ�‰
ˆØ-1¯]©]Ñ*ˆ�˜' 7Ø—‘—‘Ó ˆäØ�L‰L˜' 7¨G°W¸eó
ˆð 	�‰
ˆà�%ŠiØ—m‘m“oˆGØ&Ÿy™y›{¨G¯I©I«K�WˆGØ Ñ'¨%Ñ/ˆGØ×Ñ˜w¨°Ð9Ô:à�‰FˆAØ—n‘nÓ&ˆGð �%‹ið 'ˆÔØ× Ñ Ð r    c                 ó¢   — | j                   \  }}}}|dk(  r|S | j                  j                  «       }t        j                  ||«      }||z  |z  S )zReturn affine x coordinate.r   ©rr  rq  r   r   r‡   )r   rö   rè   r  r   rí   s         r   r;   zPointEdwards.xw  sO   € à—}‘}‰ˆˆAˆr�1Ø�Š7ØˆIØ�L‰L�N‰NÓˆÜ×(Ñ(¨¨QÓ/ˆØ�E‰z˜A‰~Ðr    c                 ó¢   — | j                   \  }}}}|dk(  r|S | j                  j                  «       }t        j                  ||«      }||z  |z  S )zReturn affine y coordinate.r   r{  )r   rè   r÷   r  r   rí   s         r   r<   zPointEdwards.y€  sO   € à—}‘}‰ˆˆ2ˆr�1Ø�Š7ØˆIØ�L‰L�N‰NÓˆÜ×(Ñ(¨¨QÓ/ˆØ�E‰z˜A‰~Ðr    c                 ó   — | j                   S )zReturn the curve of the point.)rq  r0   s    r   rr   zPointEdwards.curve‰  rå   r    c                 ó   — | j                   S r.   )rs  r0   s    r   rÃ   zPointEdwards.order�  rl  r    c                 óÜ   — | j                   \  }}}}|dk(  r| S | j                  j                  «       }t        j                  ||«      }||z  |z  }||z  |z  }||z  |z  }	||d|	f| _         | S rì   r{  )
r   rö   r÷   r  rè   r   rí   r;   r<   rv  s
             r   rª   zPointEdwards.scale�  s~   € ð Ÿ™‰ˆˆB��AØ�Š7ØˆKà�L‰L�N‰NÓˆÜ×(Ñ(¨¨QÓ/ˆØ�‰J˜‰NˆØ�‰J˜‰NˆØ�‰E�A‰IˆØ˜A˜q !˜ˆŒØˆr    c                 ó\  — | j                   \  }}}}|t        u r| xs | S t        |t        «      r|j                   \  }}}}	nt        S | j
                  |j                  «       k7  ry| j
                  j                  «       }
||z  |
z  }||z  |
z  }||z  |
z  }||z  |
z  }||k(  xr ||k(  S )ztCompare for equality two points with each-other.

        Note: only points on the same curve can be equal.
        F)rr  rØ   r#   ro  r$   rq  rr   r   )r   r&   rÚ   rÛ   rÜ   Út1rŠ   rÝ   rÞ   Út2r   Úxn1Úxn2Úyn1Úyn2s                  r   r'   zPointEdwards.__eq__¢  s»   € ð
 Ÿ™‰ˆˆB��BØ”HÑØ�6Ò# ˜VÐ#Ü�eœ\Ô*Ø"Ÿ^™^‰NˆB��B™ä!Ð!Ø�<‰<˜5Ÿ;™;›=Ò(ØØ�L‰L�N‰NÓˆð �2‰g˜‰kˆØ�2‰g˜‰kˆØ�2‰g˜‰kˆØ�2‰g˜‰kˆØ�c‰zÒ(˜c S™jÐ(r    c                 ó   — | |k(   S râ   r)   r*   s     r   r+   zPointEdwards.__ne__¹  r,   r    c                 ó
  — ||z  |	z  }||z  |	z  }||z  |	z  }||z  |	z  }||z   }||z
  ||z   z  |z   |z
  |	z  }||
|z  z   }||z
  }|s| j                  |||||	|
«      S ||z  |	z  }||z  |	z  }||z  |	z  }||z  |	z  }||||fS )z'add two points, assume sane parameters.)r  )r   rö   r÷   r  ÚT1r	  r
  r  ÚT2r   r   r  r  r  r  ÚEÚFÚGr  r  rþ   ÚT3rÿ   s                          r   r)  zPointEdwards._add½  sÖ   € ð
 �‰G�a‰KˆØ�‰G�a‰KˆØ�‰G�a‰KˆØ�‰G�a‰KˆØ�‰EˆØ�2‰g˜"˜r™'Ñ" QÑ&¨Ñ*¨aÑ/ˆØ��A‘‰IˆØ�‰EˆÙØ—<‘<  B¨¨B°°1Ó5Ð5Ø�‰U�Q‰YˆØ�‰U�Q‰YˆØ�‰U�Q‰YˆØ�‰U�Q‰Yˆà�2�r˜2ˆ~Ðr    c                 óÆ  — |t         k(  r| S t        |t        «      r| j                  |j                  k7  rt	        d«      ‚| j                  j                  «       | j                  j                  «       }}| j                  \  }}}}|j                  \  }}	}
}| j                  ||||||	|
|||«
      \  }}}}|r|st         S t        | j                  ||||| j                  «      S )zAdd point to another.z(The other point is on a different curve.)
rØ   r#   ro  rq  r™   r   r   rr  r)  rs  )r   r&   r   r   rö   r÷   r  r‰  r	  r
  r  rŠ  r  rþ   rÿ   rŽ  s                   r   r+  zPointEdwards.__add__Ó  sÅ   € à”HÒØˆKä˜5¤,Ô/Ø�|‰|˜uŸ}™}Ò,äÐGÓHÐHà�|‰|�~‰~Ó §¡§¡Ó!1ˆ1ˆØŸ™‰ˆˆB��BØŸ™‰ˆˆB��BàŸ™ 2 r¨2¨r°2°r¸2¸rÀ1ÀaÓH‰ˆˆB��Bá™ÜˆOÜ˜DŸL™L¨"¨b°"°b¸$¿,¹,ÓGÐGr    c                 ó   — | |z   S r%  r)   r*   s     r   r&  zPointEdwards.__radd__ç  r'  r    c                 óÚ   — ||z  |z  }||z  |z  }d|z  |z  |z  }	||z  |z  }
||z   ||z   z  |z
  |z
  |z  }|
|z   }||	z
  }|
|z
  }||z  |z  }||z  |z  }||z  |z  }||z  |z  }||||fS )z)Double the point, assume sane parameters.ra   r)   )r   rö   r÷   r  r‰  r   r   r  r  r  r  r‹  r�  rŒ  r  r  rþ   rŽ  rÿ   s                      r   r  zPointEdwards._doubleë  sº   € ð
 �‰G�a‰KˆØ�‰G�a‰KˆØ�‰F�R‰K˜!‰OˆØ�‰E�A‰IˆØ�2‰g˜"˜r™'Ñ" QÑ&¨Ñ*¨aÑ/ˆØ�‰EˆØ�‰EˆØ�‰EˆØ�‰U�Q‰YˆØ�‰U�Q‰YˆØ�‰U�Q‰YˆØ�‰U�Q‰Yˆà�2�r˜2ˆ~Ðr    c                 ó2  — | j                   \  }}}}|r|st        S | j                  j                  «       | j                  j	                  «       }}| j                  ||||||«      \  }}}	}
|r|
st        S t        | j                  |||	|
| j                  «      S )zReturn point added to itself.)rr  rØ   rq  r   r   r  ro  rs  )r   rö   r÷   r  r‰  r   r   r  rþ   rÿ   rŽ  s              r   rÉ   zPointEdwards.doubleÿ  s…   € àŸ™‰ˆˆB��Bá™ÜˆOà�|‰|�~‰~Ó §¡§¡Ó!1ˆ1ˆàŸ™ b¨"¨b°"°a¸Ó;‰ˆˆB��Bñ ™ÜˆOÜ˜DŸL™L¨"¨b°"°b¸$¿,¹,ÓGÐGr    c                 ó   — | |z  S r-  r)   r*   s     r   r/  zPointEdwards.__rmul__  r'  r    c                 óÞ  — dddd| j                   j                  «       | j                   j                  «       f\  }}}}}}| j                  }| j                  D ]f  \  }	}
}|dz  }|dk(  s|dk(  r|dz  }Œ|dk(  r!|dz   dz  } ||||||	 |
d| ||«
      \  }}}}ŒB|dk(  sJ ‚|dz
  dz  } ||||||	|
d|||«
      \  }}}}Œh |r|st
        S t        | j                   ||||| j                  «      S )r1  r   r   r±   ra   rl   )rq  r   r   r)  ru  rØ   ro  rs  )r   r&   r  rþ   rÿ   rŽ  r   r   r)  r	  r
  rŠ  Úrems                r   r2  zPointEdwards._mul_precompute  s  € à  ! Q¨¨4¯<©<¯>©>Ó+;¸T¿\¹\¿^¹^Ó=MÐMÑˆˆB��B˜˜1Ø�y‰yˆØ×+Ô+‰JˆB��BØ˜!‘)ˆCØ�aŠx˜3 !š8Ø˜!‘‘Ø˜’Ø ™ qÑ(�Ù!% b¨"¨b°"°r°c¸2¸qÀ2À#ÀqÈ!Ó!L‘��B˜™Bà˜a’x��xØ ™ qÑ(�Ù!% b¨"¨b°"°b¸"¸aÀÀQÈÓ!J‘��B˜™Bð ,ñ ™ÜˆOä˜DŸL™L¨"¨b°"°b¸$¿,¹,ÓGÐGr    c                 ó   — | j                   \  }}}}|r|r|st        S |dk(  r| S | j                  r|| j                  dz  z  }| j                  «       r| j	                  |«      S d\  }}}}	| j
                  j                  «       | j
                  j                  «       }}
| j                  }| j                  }t        | j                  |«      «      D ]N  } |||||	|
|«      \  }}}}	|dk  r |||||	| ||| |
|«
      \  }}}}	Œ3|dkD  sŒ9 |||||	|||||
|«
      \  }}}}	ŒP |r|	st        S t        | j
                  ||||	| j                  «      S )r.  r   ra   )r   r   r   r   r   )rr  rØ   rs  rÍ   r2  rq  r   r   r  r)  r4  r¶   ro  )r   r&   r	  r
  r  rŠ  r  rþ   rÿ   rŽ  r   r   r  r)  r•   s                  r   r5  zPointEdwards.__mul__)  sW  € àŸ™‰ˆˆB��BÙ™¡5ÜˆOØ�AŠ:ØˆKØ�<Š<à˜TŸ\™\¨AÑ-Ñ.ˆEØ×!Ñ!Ô#Ø×'Ñ'¨Ó.Ð.à#‰ˆˆB��BØ�|‰|�~‰~Ó §¡§¡Ó!1ˆ1ˆØ—,‘,ˆØ�y‰yˆä˜$Ÿ)™) EÓ*Ö+ˆAÙ$ R¨¨R°°Q¸Ó:‰NˆB��B˜Ø�1ŠuÙ!% b¨"¨b°"°r°c¸2¸rÀBÀ3ÈÈ1Ó!M‘��B˜™BØ�Q“Ù!% b¨"¨b°"°b¸"¸bÀ"ÀaÈÓ!K‘��B˜™Bð ,ñ ™ÜˆOä˜DŸL™L¨"¨b°"°b¸$¿,¹,ÓGÐGr    rM  )NNNF)rA   rB   rC   rD   r   r¸   r�   rÍ   r;   r<   rr   rÃ   rª   r'   r+   r)  r+  r&  r  rÉ   r/  r2  r5  rN  rO  s   @r   ro  ro    s…   ø„ ñõð ð
 ØØØô(
ó ð(
òT#!òJòòòòò$)ò.!òò,Hò(òò(Hò"òHö*Hr    ro  N)Ú
__future__r   Úgmpy2r   rE   ÚImportErrorÚgmpyÚsixr   Ú r   Ú_compatr   r	   r
   r   Úerrorsr   Úutilr   r   r   Úobjectr   rG   r_   rº   rÙ   ro  rØ   r)   r    r   Ú<module>r¡     sà   ðõF  ð
Ýà€Dõ ,Ý ß LÓ LÝ 'ß >Ñ >ð ô\
ˆfó \
ó ð\
ô~V
�ô V
ôrE�Fô EôPA	A�-ô A	AôHLˆMô Lô^xH�=ô xHñx	 ��t˜TÓ"�øðA1 ò ðÝà‰øØò ØŠðüðús5   ˆB
 Â
B)ÂBÂB)ÂB#Â B)Â"B#Â#B)Â(B)