File: //proc/thread-self/root/lib/python3/dist-packages/nacl/__pycache__/utils.cpython-38.pyc
U
�֫[� � @ sZ d dl mZmZmZ d dlZd dlZG dd� de�ZG dd� de�Z dd� Z
dd
d�ZdS )
� )�absolute_import�division�print_functionNc @ s4 e Zd ZdZedd� �Zedd� �Zedd� �ZdS ) �EncryptedMessageze
A bytes subclass that holds a messaged that has been encrypted by a
:class:`SecretBox`.
c C s | |�}||_ ||_|S �N)�_nonce�_ciphertext)�cls�nonce�
ciphertextZcombined�obj� r
�,/usr/lib/python3/dist-packages/nacl/utils.py�_from_parts s zEncryptedMessage._from_partsc C s | j S )zX
The nonce used during the encryption of the :class:`EncryptedMessage`.
)r ��selfr
r
r r
# s zEncryptedMessage.noncec C s | j S )zP
The ciphertext contained within the :class:`EncryptedMessage`.
)r r r
r
r r * s zEncryptedMessage.ciphertextN) �__name__�
__module__�__qualname__�__doc__�classmethodr �propertyr
r r
r
r
r r s
r c @ s e Zd Zdd� ZdS )�StringFixerc C s t jrt| �� �S | �� S d S r )�six�PY3�str� __bytes__r r
r
r �__str__4 s zStringFixer.__str__N)r r r r r
r
r
r r 2 s r c C s t jr| �d�S | S d S )N�ascii)r r �decode)Zbytes_inr
r
r �bytes_as_string; s
r � c C s
t �| �S r )�os�urandom)�sizer
r
r �randomB s r% )r! )Z
__future__r r r r"