
    +hm                    R   d dl mZ d dlZd dlmZmZ d dlmZ d dl	m
Z
  G d dej                        Z eed	      r%ej                  ej                  j                          G d
 dej                        Z eed	      r&ej                  ej                  j                          yy)    )annotationsN)UnsupportedAlgorithm_Reasons)openssl)_serializationc                      e Zd Zedd       Zej                  	 	 	 	 	 	 dd       Zej                  dd       Zej                  d	d       Z	y)
X25519PublicKeyc                    ddl m} |j                         st        dt        j
                        |j                  |      S Nr   )backendz3X25519 is not supported by this version of OpenSSL.),cryptography.hazmat.backends.openssl.backendr   x25519_supportedr   r   UNSUPPORTED_EXCHANGE_ALGORITHMx25519_load_public_bytesclsdatar   s      c/var/www/html/venv/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.pyfrom_public_bytesz!X25519PublicKey.from_public_bytes   s=    H'')&E77 
 //55    c                     y)z9
        The serialized bytes of the public key.
        N )selfencodingformats      r   public_byteszX25519PublicKey.public_bytes       r   c                     y)z`
        The raw bytes of the public key.
        Equivalent to public_bytes(Raw, Raw).
        Nr   r   s    r   public_bytes_rawz X25519PublicKey.public_bytes_raw%   r   r   c                     y)z"
        Checks equality.
        Nr   )r   others     r   __eq__zX25519PublicKey.__eq__,   r   r   N)r   bytesreturnr	   )r   _serialization.Encodingr   z_serialization.PublicFormatr%   r$   r%   r$   )r"   objectr%   bool)
__name__
__module____qualname__classmethodr   abcabstractmethodr   r    r#   r   r   r   r	   r	      s~    	6 	6 	) , 
	  	  	 r   r	   )	metaclassx25519c                      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
ej                  dd       Zy)X25519PrivateKeyc                    ddl m} |j                         st        dt        j
                        |j                         S r   )r   r   r   r   r   r   x25519_generate_key)r   r   s     r   generatezX25519PrivateKey.generate9   s;    H'')&E77  **,,r   c                    ddl m} |j                         st        dt        j
                        |j                  |      S r   )r   r   r   r   r   r   x25519_load_private_bytesr   s      r   from_private_bytesz#X25519PrivateKey.from_private_bytesD   s=    H'')&E77 
 0066r   c                     y)zJ
        Returns the public key assosciated with this private key
        Nr   r   s    r   
public_keyzX25519PrivateKey.public_keyP   r   r   c                     y)z:
        The serialized bytes of the private key.
        Nr   )r   r   r   encryption_algorithms       r   private_byteszX25519PrivateKey.private_bytesV   r   r   c                     y)zr
        The raw bytes of the private key.
        Equivalent to private_bytes(Raw, Raw, NoEncryption()).
        Nr   r   s    r   private_bytes_rawz"X25519PrivateKey.private_bytes_rawa   r   r   c                     y)zY
        Performs a key exchange operation using the provided peer's public key.
        Nr   )r   peer_public_keys     r   exchangezX25519PrivateKey.exchangeh   r   r   N)r%   r3   )r   r$   r%   r3   )r%   r	   )r   r&   r   z_serialization.PrivateFormatr=   z)_serialization.KeySerializationEncryptionr%   r$   r'   )rB   r	   r%   r$   )r*   r+   r,   r-   r6   r9   r.   r/   r;   r>   r@   rC   r   r   r   r3   r3   8   s    - - 	7 	7 	 
 	) - H	
 
  	  	 r   r3   )
__future__r   r.   cryptography.exceptionsr   r   "cryptography.hazmat.bindings._rustr   rust_opensslcryptography.hazmat.primitivesr   ABCMetar	   hasattrregisterr1   r3   r   r   r   <module>rL      s   
 # 
 B F 9" "L <"\00@@A4 4p <"l11BBC #r   