
    7g%	              	           d dl Z d dlmZmZmZ d dlZd dlmZ  edd          Z G d de	          Z
 G d d	          Zd
e	defdZddede	fdZej        fdede	dej        de	fdZdS )    N)SupportsBytesTypeTypeVar)encoding_EncryptedMessageEncryptedMessage)boundc                       e Zd ZU dZeed<   eed<   edee         dedededef
d	            Z	e
defd
            Ze
defd            ZdS )r   ze
    A bytes subclass that holds a messaged that has been encrypted by a
    :class:`SecretBox`.
    _nonce_ciphertextclsnonce
ciphertextcombinedreturnc                 8     | |          }||_         ||_        |S N)r   r   )r   r   r   r   objs        D/var/www/html/syslog/venv/lib/python3.11/site-packages/nacl/utils.py_from_partszEncryptedMessage._from_parts"   s$     c(mm
$
    c                     | j         S )zX
        The nonce used during the encryption of the :class:`EncryptedMessage`.
        )r   selfs    r   r   zEncryptedMessage.nonce.   s    
 {r   c                     | j         S )zP
        The ciphertext contained within the :class:`EncryptedMessage`.
        )r   r   s    r   r   zEncryptedMessage.ciphertext5   s    
 r   N)__name__
__module____qualname____doc__bytes__annotations__classmethodr   r   r   propertyr   r    r   r   r   r      s          
 MMM	#$		 	 		
 
	 	 	 [	 u    X  E       X     r   c                       e Zd ZdedefdZdS )StringFixerr   r   c                 D    t          |                                           S r   )str	__bytes__r   s    r   __str__zStringFixer.__str__>   s    4>>##$$$r   N)r   r   r   r   r(   r*   r$   r   r   r&   r&   =   s6        %m % % % % % % %r   r&   bytes_inr   c                 ,    |                      d          S )Nascii)decode)r+   s    r   bytes_as_stringr/   B   s    ??7###r       sizec                 *    t          j        |           S r   )osurandom)r1   s    r   randomr5   F   s    :dr   seedencoderc                 l    t           j                            | |          }|                    |          S )z
    Returns ``size`` number of deterministically generated pseudorandom bytes
    from a seed

    :param size: int
    :param seed: bytes
    :param encoder: The encoder class used to encode the produced bytes
    :rtype: bytes
    )naclbindingsrandombytes_buf_deterministicencode)r1   r6   r7   raw_datas       r   randombytes_deterministicr>   J   s-     }::4FFH>>(###r   )r0   )r3   typingr   r   r   nacl.bindingsr9   r   r   r    r   r&   r(   r/   intr5   
RawEncoderEncoderr>   r$   r   r   <module>rD      sN    
			 / / / / / / / / / /          G/7IJJJ !  !  !  !  ! u !  !  ! H% % % % % % % %
$e $ $ $ $ $  e    
 9A8K$ $
$$%-%5$
$ $ $ $ $ $r   