U
    *”}fa	  ã                   @   sx   d dl mZmZmZ d dlZd dlZd dlmZmZ dZ	d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Ú_Reasonsé    é@   c                   @   s4   e Zd Zedd„ ƒZejdd„ ƒZejdd„ ƒZdS )ÚEd25519PublicKeyc                 C   s*   ddl m} | ¡ s tdtjƒ‚| |¡S ©Nr   )Úbackendz4ed25519 is not supported by this version of OpenSSL.)Ú,cryptography.hazmat.backends.openssl.backendr   Úed25519_supportedr   r   Ú UNSUPPORTED_PUBLIC_KEY_ALGORITHMZed25519_load_public_bytes©ÚclsÚdatar   © r   úU/tmp/pip-unpacked-wheel-x36vw73o/cryptography/hazmat/primitives/asymmetric/ed25519.pyÚfrom_public_bytes   s    þz"Ed25519PublicKey.from_public_bytesc                 C   s   dS )z9
        The serialized bytes of the public key.
        Nr   )ÚselfÚencodingÚformatr   r   r   Úpublic_bytes    s    zEd25519PublicKey.public_bytesc                 C   s   dS )z'
        Verify the signature.
        Nr   )r   Ú	signaturer   r   r   r   Úverify&   s    zEd25519PublicKey.verifyN)	Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   ÚabcÚabstractmethodr   r   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 )ÚEd25519PrivateKeyc                 C   s(   ddl m} | ¡ s tdtjƒ‚| ¡ S r
   )r   r   r   r   r   r   Zed25519_generate_key)r   r   r   r   r   Úgenerate/   s    þzEd25519PrivateKey.generatec                 C   s*   ddl m} | ¡ s tdtjƒ‚| |¡S r
   )r   r   r   r   r   r   Zed25519_load_private_bytesr   r   r   r   Úfrom_private_bytes;   s    þz$Ed25519PrivateKey.from_private_bytesc                 C   s   dS )zD
        The Ed25519PublicKey derived from the private key.
        Nr   )r   r   r   r   Ú
public_keyG   s    zEd25519PrivateKey.public_keyc                 C   s   dS )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   Zencryption_algorithmr   r   r   Úprivate_bytesM   s    zEd25519PrivateKey.private_bytesc                 C   s   dS )z!
        Signs the data.
        Nr   )r   r   r   r   r   ÚsignS   s    zEd25519PrivateKey.signN)r   r   r   r   r"   r#   r   r    r$   r%   r&   r   r   r   r   r!   -   s   



r!   )Ú
__future__r   r   r   r   ÚsixZcryptography.exceptionsr   r   Z_ED25519_KEY_SIZEZ_ED25519_SIG_SIZEÚadd_metaclassÚABCMetaÚobjectr	   r!   r   r   r   r   Ú<module>   s   

