U
    çe¨]é  ã                   @   sp   d dl mZmZmZ d dlZd dlZd dlmZmZ e 	ej
¡G dd„ deƒƒZe 	ej
¡G dd„ deƒƒZdS )é    )Úabsolute_importÚdivisionÚprint_functionN)ÚUnsupportedAlgorithmÚ_Reasonsc                   @   s(   e Zd Zedd„ ƒZejddd„ƒZdS )ÚX25519PublicKeyc                 C   s*   ddl m} | ¡ s tdtjƒ‚| |¡S ©Nr   )Úbackendz3X25519 is not supported by this version of OpenSSL.)Ú,cryptography.hazmat.backends.openssl.backendr	   Úx25519_supportedr   r   ÚUNSUPPORTED_EXCHANGE_ALGORITHMZx25519_load_public_bytes©ÚclsÚdatar	   © r   úR/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/asymmetric/x25519.pyÚfrom_public_bytes   s    þz!X25519PublicKey.from_public_bytesNc                 C   s   dS ©z9
        The serialized bytes of the public key.
        Nr   )ÚselfÚencodingÚformatr   r   r   Úpublic_bytes   s    zX25519PublicKey.public_bytes)NN)Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   ÚabcÚabstractmethodr   r   r   r   r   r      s   

r   c                   @   sN   e Zd Zedd„ ƒZedd„ ƒZejdd„ ƒZejdd„ ƒZ	ejd	d
„ ƒZ
dS )ÚX25519PrivateKeyc                 C   s(   ddl m} | ¡ s tdtjƒ‚| ¡ S r   )r
   r	   r   r   r   r   Zx25519_generate_key)r   r	   r   r   r   Úgenerate$   s    þzX25519PrivateKey.generatec                 C   s*   ddl m} | ¡ s tdtjƒ‚| |¡S r   )r
   r	   r   r   r   r   Zx25519_load_private_bytesr   r   r   r   Úfrom_private_bytes.   s    þz#X25519PrivateKey.from_private_bytesc                 C   s   dS r   r   )r   r   r   r   Ú
public_key9   s    zX25519PrivateKey.public_keyc                 C   s   dS )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   Zencryption_algorithmr   r   r   Úprivate_bytes?   s    zX25519PrivateKey.private_bytesc                 C   s   dS )zY
        Performs a key exchange operation using the provided peer's public key.
        Nr   )r   Zpeer_public_keyr   r   r   ÚexchangeE   s    zX25519PrivateKey.exchangeN)r   r   r   r   r   r    r   r   r!   r"   r#   r   r   r   r   r   "   s   
	



r   )Z
__future__r   r   r   r   ZsixZcryptography.exceptionsr   r   Zadd_metaclassÚABCMetaÚobjectr   r   r   r   r   r   Ú<module>   s   

