o
    �)%aŸ
  ã                   @   sX   d dl Z d dlmZmZ d dlmZ dZdZG dd„ de jd�Z	G d	d
„ d
e jd�Z
dS )é    N)ÚUnsupportedAlgorithmÚ_Reasons)Ú_serializationé    é@   c                   @   s^   e Zd Zededd fdd„ƒZejdej	dej
defdd„ƒZejd	ededd
fdd„ƒZd
S )ÚEd25519PublicKeyÚdataÚreturnc                 C   ó*   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_ALGORITHMÚed25519_load_public_bytes©Úclsr   r   © r   úS/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/asymmetric/ed25519.pyÚfrom_public_bytes   ó   þ
z"Ed25519PublicKey.from_public_bytesÚencodingÚformatc                 C   ó   dS )z9
        The serialized bytes of the public key.
        Nr   )Úselfr   r   r   r   r   Úpublic_bytes   ó    zEd25519PublicKey.public_bytesÚ	signatureNc                 C   r   )z'
        Verify the signature.
        Nr   )r   r   r   r   r   r   Úverify'   r   zEd25519PublicKey.verify)Ú__name__Ú
__module__Ú__qualname__ÚclassmethodÚbytesr   ÚabcÚabstractmethodr   ÚEncodingÚPublicFormatr   r   r   r   r   r   r      s    þýü	r   )Ú	metaclassc                   @   s~   e Zd Zeddd„ƒZededd fdd„ƒZejde	fdd„ƒZ
ejd	ejd
ejdejfdd„ƒZejdedefdd„ƒZdS )ÚEd25519PrivateKeyr	   c                 C   s(   ddl m} | ¡ stdtjƒ‚| ¡ S r   )r   r   r   r   r   r   Úed25519_generate_key)r   r   r   r   r   Úgenerate/   s   þzEd25519PrivateKey.generater   c                 C   r
   r   )r   r   r   r   r   r   Úed25519_load_private_bytesr   r   r   r   Úfrom_private_bytes;   r   z$Ed25519PrivateKey.from_private_bytesc                 C   r   )zD
        The Ed25519PublicKey derived from the private key.
        Nr   )r   r   r   r   Ú
public_keyG   r   zEd25519PrivateKey.public_keyr   r   Úencryption_algorithmc                 C   r   )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   r/   r   r   r   Úprivate_bytesM   r   zEd25519PrivateKey.private_bytesc                 C   r   )z!
        Signs the data.
        Nr   )r   r   r   r   r   ÚsignX   r   zEd25519PrivateKey.signN)r	   r)   )r   r    r!   r"   r+   r#   r-   r$   r%   r   r.   r   r&   ÚPrivateFormatÚKeySerializationEncryptionr0   r1   r   r   r   r   r)   .   s"    þýü
r)   )r$   Úcryptography.exceptionsr   r   Úcryptography.hazmat.primitivesr   Ú_ED25519_KEY_SIZEÚ_ED25519_SIG_SIZEÚABCMetar   r)   r   r   r   r   Ú<module>   s   