File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Protocol/__pycache__/DH.cpython-310.pyc
Back
o ;j � @ sX d dl mZ d dlmZmZmZmZ dd� Zdd� Zdd� Z d d � Z dd� Zd d� ZdS )� )� long_to_bytes)�EccKey� construct�_import_curve25519_public_key�_import_curve448_public_keyc C st |j | j }|�� rtd��| jdkrt|jjddd��}|S | jdkr0t|jjddd��}|S t|j|� � �}|S )NzInvalid ECDH point� Curve25519� �little)� byteorder�Curve448�8 ) ZpointQ�dZis_point_at_infinity� ValueError�curve� bytearray�x�to_bytesr Z size_in_bytes)Zkey_privZkey_pubZpointP�z� r �J/opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Protocol/DH.py� _compute_ecdh s ��r c C � t | �}td|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:`Cryptodome.PublicKey.EccKey` : a new ECC key object. Raises: ValueError: when the given key cannot be parsed. r �r Zpoint_x)r r ��encodedr r r r �import_x25519_public_key � r c C � t | dd�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:`Cryptodome.PublicKey.EccKey` : a new ECC key object. Raises: ValueError: when the given key cannot be parsed. r ��seedr �r �r r r r �import_x25519_private_key, � r"