Ë
    (üàgô  ã                   óL   — d dl mZ d dlmZmZmZmZ d„ Zd„ Zd„ Z	d„ Z
d„ Zd„ Zy	)
é    )Úlong_to_bytes)ÚEccKeyÚ	constructÚ_import_curve25519_public_keyÚ_import_curve448_public_keyc                 ó’  — |j                   | j                  z  }|j                  «       rt        d«      ‚| j                  dk(  r(t        |j                  j                  dd¬«      «      }|S | j                  dk(  r(t        |j                  j                  dd¬«      «      }|S t        |j                  |j                  «       «      }|S )NzInvalid ECDH pointÚ
Curve25519é    Úlittle)Ú	byteorderÚCurve448é8   )
ÚpointQÚdÚis_point_at_infinityÚ
ValueErrorÚcurveÚ	bytearrayÚxÚto_bytesr   Úsize_in_bytes)Úkey_privÚkey_pubÚpointPÚzs       úP/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/Crypto/Protocol/DH.pyÚ_compute_ecdhr      s°   € Ø�^‰^˜hŸj™jÑ(€FØ×"Ñ"Ô$ÜÐ.Ó/Ð	/à‡~�~˜Ò%Ü�f—h‘h×'Ñ'¨°hÐ'Ó?Ó@ˆð €Hð 
�‰˜:Ò	%Ü�f—h‘h×'Ñ'¨°hÐ'Ó?Ó@ˆð €Hô ˜&Ÿ(™( F×$8Ñ$8Ó$:Ó;ˆØ€Hó    c                 ó2   — t        | «      }t        d|¬«      S )a€  Create a new X25519 public key object,
    starting from the key encoded as raw ``bytes``,
    in the format described in RFC7748.

    Args:
      encoded (bytes):
        The x25519 public key to import.
        It must be 32 bytes.

    Returns:
      :class:`Crypto.PublicKey.EccKey` : a new ECC key object.

    Raises:
      ValueError: when the given key cannot be parsed.
    r	   ©r   Úpoint_x)r   r   ©Úencodedr   s     r   Úimport_x25519_public_keyr$      s   € ô" 	& gÓ.€AÜ˜<°Ô3Ð3r   c                 ó   — t        | d¬«      S )a‚  Create a new X25519 private key object,
    starting from the key encoded as raw ``bytes``,
    in the format described in RFC7748.

    Args:
      encoded (bytes):
        The X25519 private key to import.
        It must be 32 bytes.

    Returns:
      :class:`Crypto.PublicKey.EccKey` : a new ECC key object.

    Raises:
      ValueError: when the given key cannot be parsed.
    r	   ©Úseedr   ©r   ©r#   s    r   Úimport_x25519_private_keyr*   ,   s   € ô" ˜'¨Ô6Ð6r   c                 ó2   — t        | «      }t        d|¬«      S )a|  Create a new X448 public key object,
    starting from the key encoded as raw ``bytes``,
    in the format described in RFC7748.

    Args:
      encoded (bytes):
        The x448 public key to import.
        It must be 56 bytes.

    Returns:
      :class:`Crypto.PublicKey.EccKey` : a new ECC key object.

    Raises:
      ValueError: when the given key cannot be parsed.
    r   r    )r   r   r"   s     r   Úimport_x448_public_keyr,   @   s   € ô" 	$ GÓ,€AÜ˜:¨qÔ1Ð1r   c                 ó   — t        | d¬«      S )a~  Create a new X448 private key object,
    starting from the key encoded as raw ``bytes``,
    in the format described in RFC7748.

    Args:
      encoded (bytes):
        The X448 private key to import.
        It must be 56 bytes.

    Returns:
      :class:`Crypto.PublicKey.EccKey` : a new ECC key object.

    Raises:
      ValueError: when the given key cannot be parsed.
    r   r&   r(   r)   s    r   Úimport_x448_private_keyr.   U   s   € ô" ˜'¨Ô4Ð4r   c                  ó–  — | j                  dd«      }| j                  dd«      }| j                  dd«      }| j                  dd«      }| j                  dd«      }|€t        d«      ‚d}d}d}d	„ }	|� |	||dd
«      }|dz  }|� |	||dd«      }|dz  }|� |	||dd
«      }|dz  }|� |	||dd«      }|dz  }||z   dk  s
|dk(  s|dk(  rt        d«      ‚d}
d}|r|rt        ||«      }
|r1|r/t        |«      t        |«      k7  rt        d«      ‚t        ||«      }n!|r|rt        ||«      }n|r|rt        ||«      }||
z   } ||«      S )aÌ  Perform a Diffie-Hellman key agreement.

    Keywords:
      kdf (callable):
        A key derivation function that accepts ``bytes`` as input and returns
        ``bytes``.
      static_priv (EccKey):
        The local static private key. Optional.
      static_pub (EccKey):
        The static public key that belongs to the peer. Optional.
      eph_priv (EccKey):
        The local ephemeral private key, generated for this session. Optional.
      eph_pub (EccKey):
        The ephemeral public key, received from the peer for this session. Optional.

    At least two keys must be passed, of which one is a private key and one
    a public key.

    Returns (bytes):
      The derived secret key material.
    Ústatic_privNÚ
static_pubÚeph_privÚeph_pubÚkdfz'kdf' is mandatoryr   c                 óÜ   — t        |t        «      st        d|z  «      ‚|r|j                  «       st        d|z  «      ‚| €|j                  } | S | |j                  k7  rt        d|z  «      ‚| S )Nz'%s' must be an ECC keyz'%s' must be a private ECC keyz('%s' is defined on an incompatible curve)Ú
isinstancer   Ú	TypeErrorÚhas_privater   )r   ÚkeyÚnameÚprivates       r   Úcheck_curvez"key_agreement.<locals>.check_curve�   ss   € Ü˜#œvÔ&ÜÐ5¸Ñ<Ó=Ð=Ù˜3Ÿ?™?Ô,ÜÐ<¸tÑCÓDÐDØˆ=Ø—I‘IˆEð ˆð �c—i‘iÒÜÐFÈÑMÓNÐNØˆr   Té   Fé   z'Too few keys for the ECDH key agreementr   z"DH mode C(2e, 1s) is not supported)Úgetr   r   Úbool)Úkwargsr0   r1   r2   r3   r4   Ú
count_privÚ	count_pubr   r<   ÚZsÚZeÚZs                r   Úkey_agreementrG   i   sš  € ð. —*‘*˜]¨DÓ1€KØ—‘˜L¨$Ó/€JØ�z‰z˜* dÓ+€HØ�j‰j˜ DÓ)€GØ
�*‰*�U˜DÓ
!€Cà
€{ÜÐ-Ó.Ð.à€JØ€IØ€Eò	ð ÐÙ˜E ;°¸tÓDˆØ�a‰ˆ
àÐÙ˜E :¨|¸UÓCˆØ�Q‰ˆ	àÐÙ˜E 8¨Z¸Ó>ˆØ�a‰ˆ
àÐÙ˜E 7¨I°uÓ=ˆØ�Q‰ˆ	à�YÑ !Ò# z°Q¢¸)Àqº.ÜÐBÓCÐCà	€BØ	€Bá‘zä˜;¨
Ó3ˆá‘Gä�Ó¤ ZÓ 0Ò0ÜÐAÓBÐBÜ˜8 WÓ-‰Ù	‘jä˜8 ZÓ0‰Ù	‘[ä˜;¨Ó0ˆà
ˆR‰€Aáˆq‹6€Mr   N)ÚCrypto.Util.numberr   ÚCrypto.PublicKey.ECCr   r   r   r   r   r$   r*   r,   r.   rG   © r   r   ú<module>rK      s1   ðÝ ,÷?ó ?òò4ò*7ò(2ò*5ó(Wr   