U
    Á“«j¶  ã                   @  s€   d dl mZ d dlZd dlmZ d dlmZ d dlm	Z	 G dd„ dej
d�Ze ejj¡ G d	d
„ d
ej
d�Ze ejj¡ dS )é    )ÚannotationsN)Úopenssl)Ú_serialization)ÚBufferc                   @  s¤   e Zd Zedd dœdd„ƒZejddddœdd	„ƒZejdd
œdd„ƒZejddddœdd„ƒZ	ejdddœdd„ƒZ
ejd d
œdd„ƒZejdd dœdd„ƒZdS )ÚEd25519PublicKeyÚbytes©ÚdataÚreturnc                 C  s   t j |¡S ©N)Úrust_opensslÚed25519Úfrom_public_bytes©Úclsr	   © r   úU/tmp/pip-unpacked-wheel-w0_gbkxc/cryptography/hazmat/primitives/asymmetric/ed25519.pyr      s    z"Ed25519PublicKey.from_public_bytesú_serialization.Encodingz_serialization.PublicFormat)ÚencodingÚformatr
   c                 C  s   dS )z9
        The serialized bytes of the public key.
        Nr   )Úselfr   r   r   r   r   Úpublic_bytes   s    zEd25519PublicKey.public_bytes©r
   c                 C  s   dS )z`
        The raw bytes of the public key.
        Equivalent to public_bytes(Raw, Raw).
        Nr   ©r   r   r   r   Úpublic_bytes_raw   s    z!Ed25519PublicKey.public_bytes_rawr   ÚNone)Ú	signaturer	   r
   c                 C  s   dS )z'
        Verify the signature.
        Nr   )r   r   r	   r   r   r   Úverify$   s    zEd25519PublicKey.verifyÚobjectÚbool)Úotherr
   c                 C  s   dS )z"
        Checks equality.
        Nr   )r   r    r   r   r   Ú__eq__*   s    zEd25519PublicKey.__eq__c                 C  s   dS ©z!
        Returns a copy.
        Nr   r   r   r   r   Ú__copy__0   s    zEd25519PublicKey.__copy__Údict©Úmemor
   c                 C  s   dS ©z&
        Returns a deep copy.
        Nr   ©r   r&   r   r   r   Ú__deepcopy__6   s    zEd25519PublicKey.__deepcopy__N)Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   ÚabcÚabstractmethodr   r   r   r!   r#   r)   r   r   r   r   r      s   	r   )Ú	metaclassc                   @  s´   e Zd Zed dœdd„ƒZedd dœdd„ƒZejddœd	d
„ƒZejdddddœdd„ƒZ	ejddœdd„ƒZ
ejdddœdd„ƒZejd dœdd„ƒZejdd dœdd„ƒZdS )ÚEd25519PrivateKeyr   c                 C  s
   t j ¡ S r   )r   r   Zgenerate_key)r   r   r   r   ÚgenerateA   s    zEd25519PrivateKey.generater   r   c                 C  s   t j |¡S r   )r   r   Úfrom_private_bytesr   r   r   r   r3   E   s    z$Ed25519PrivateKey.from_private_bytesr   c                 C  s   dS )zD
        The Ed25519PublicKey derived from the private key.
        Nr   r   r   r   r   Ú
public_keyI   s    zEd25519PrivateKey.public_keyr   z_serialization.PrivateFormatz)_serialization.KeySerializationEncryptionr   )r   r   Úencryption_algorithmr
   c                 C  s   dS )z:
        The serialized bytes of the private key.
        Nr   )r   r   r   r5   r   r   r   Úprivate_bytesO   s    zEd25519PrivateKey.private_bytesc                 C  s   dS )zr
        The raw bytes of the private key.
        Equivalent to private_bytes(Raw, Raw, NoEncryption()).
        Nr   r   r   r   r   Úprivate_bytes_rawZ   s    z#Ed25519PrivateKey.private_bytes_rawc                 C  s   dS )z!
        Signs the data.
        Nr   )r   r	   r   r   r   Úsigna   s    zEd25519PrivateKey.signc                 C  s   dS r"   r   r   r   r   r   r#   g   s    zEd25519PrivateKey.__copy__r$   r%   c                 C  s   dS r'   r   r(   r   r   r   r)   m   s    zEd25519PrivateKey.__deepcopy__N)r*   r+   r,   r-   r2   r3   r.   r/   r4   r6   r7   r8   r#   r)   r   r   r   r   r1   @   s    
r1   )Ú
__future__r   r.   Z"cryptography.hazmat.bindings._rustr   r   Zcryptography.hazmat.primitivesr   Zcryptography.utilsr   ÚABCMetar   Úregisterr   r1   r   r   r   r   Ú<module>   s   /4