%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/paramiko/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/paramiko/__pycache__/kex_curve25519.cpython-312.pyc |
� �ecg � �� � d dl Z d dlZd dlmZ d dlmZmZ d dlmZm Z d dl mZ d dlm Z mZ d dlmZ edd � \ ZZ edd � D � cg c] } e | � �� c} \ ZZ G d � de� Zyc c} w )� N)�UnsupportedAlgorithm)� constant_time� serialization)�X25519PrivateKey�X25519PublicKey)�Message)�byte_chr�long)�SSHException� � c �X � e Zd Zej Zd� Zed� � Zd� Z d� Z d� Zd� Zd� Z y) � KexCurve25519c � � || _ d | _ y �N)� transport�key)�selfr s �9/usr/lib/python3/dist-packages/paramiko/kex_curve25519.py�__init__zKexCurve25519.__init__ s � �"������ c �L � t j � y# t $ r Y yw xY w)NTF)r �generater )�clss r �is_availablezKexCurve25519.is_available s, � � ��%�%�'� �� $� �� �s � � #�#c �~ � | j j |� }t j |d� rt d� �|S )Ns z.peer's curve25519 public value has wrong order)r �exchanger �bytes_eqr )r �peer_key�secrets r �_perform_exchangezKexCurve25519._perform_exchange$ s= � ����"�"�8�,���!�!�&�,�7��@�� � � r c �& � t j � | _ | j j r | j j t � y t � }|j t � |j | j j � j t j j t j j � � | j j# |� | j j t$ � y r )r r r r �server_mode�_expect_packet�_MSG_KEXECDH_INITr �add_byte�c_MSG_KEXECDH_INIT� add_string� public_key�public_bytesr �Encoding�Raw�PublicFormat� _send_message�_MSG_KEXECDH_REPLY)r �ms r � start_kexzKexCurve25519.start_kex, s� � �#�,�,�.����>�>�%�%��N�N�)�)�*;�<���I�� � � �%�&� ����H�H���!�.�.��&�&�*�*�M�,F�,F�,J�,J� � � ���$�$�Q�'����%�%�&8�9r c � � | j j r|t k( r| j |� S | j j s|t k( r| j |� S t dj |� � �)Nz.KexCurve25519 asked to handle packet type {:d})r r# r% �_parse_kexecdh_initr/ �_parse_kexecdh_replyr �format)r �ptyper0 s r � parse_nextzKexCurve25519.parse_next<