
    Ii%	              	           S SK r S SKJrJrJr  S SKrS SKJr  \" SSS9r " S S\	5      r
 " S S	5      rS
\	S\4S jrSS\S\	4S jjr\R                   4S\S\	S\R"                  S\	4S jjrg)    N)SupportsBytesTypeTypeVar)encoding_EncryptedMessageEncryptedMessage)boundc                       \ rS rSr% Sr\\S'   \\S'   \S\\	   S\S\S\S	\	4
S
 j5       r
\S	\4S j5       r\S	\4S j5       rSrg)r      zY
A bytes subclass that holds a messaged that has been encrypted by a
:class:`SecretBox`.
_nonce_ciphertextclsnonce
ciphertextcombinedreturnc                 .    U " U5      nXl         X$l        U$ N)r   r   )r   r   r   r   objs        0/venv/lib/python3.13/site-packages/nacl/utils.py_from_partsEncryptedMessage._from_parts"   s     (m
$
    c                     U R                   $ )zH
The nonce used during the encryption of the :class:`EncryptedMessage`.
)r   selfs    r   r   EncryptedMessage.nonce.   s    
 {{r   c                     U R                   $ )z@
The ciphertext contained within the :class:`EncryptedMessage`.
)r   r   s    r   r   EncryptedMessage.ciphertext5   s    
 r    N)__name__
__module____qualname____firstlineno____doc__bytes__annotations__classmethodr   r   r   propertyr   r   __static_attributes__r    r   r   r   r      s    
 M	#$		 	 		
 
	 	 u    E    r   c                   &    \ rS rSrS\S\4S jrSrg)StringFixer=   r   r   c                 4    [        U R                  5       5      $ r   )str	__bytes__r   s    r   __str__StringFixer.__str__>   s    4>>#$$r   r    N)r!   r"   r#   r$   r   r/   r1   r*   r    r   r   r,   r,   =   s    %m % %r   r,   bytes_inr   c                 $    U R                  S5      $ )Nascii)decode)r3   s    r   bytes_as_stringr7   B   s    ??7##r   sizec                 .    [         R                  " U 5      $ r   )osurandom)r8   s    r   randomr<   F   s    ::dr   seedencoderc                 b    [         R                  R                  X5      nUR                  U5      $ )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)r8   r=   r>   raw_datas       r   randombytes_deterministicrE   J   s'     }}::4FH>>(##r   )    )r:   typingr   r   r   nacl.bindingsr@   r   r   r&   r   r,   r/   r7   intr<   
RawEncoderEncoderrE   r    r   r   <module>rL      s     
 / /  /7IJ ! u ! H% %
$e $ $ e 
 9A8K8K$
$$%-%5%5$
$r   