U §Ãq`vã@s|ddlmZmZmZddlZddlZddlZddlmZGdd„de ƒZ Gdd„de ƒZ dd „Z dd d „Zejfd d„ZdS)é)Úabsolute_importÚdivisionÚprint_functionN)Úencodingc@s4eZdZdZedd„ƒZedd„ƒZedd„ƒZdS) ÚEncryptedMessageze A bytes subclass that holds a messaged that has been encrypted by a :class:`SecretBox`. cCs||ƒ}||_||_|S©N)Ú_nonceÚ _ciphertext)ÚclsÚnonceÚ ciphertextZcombinedÚobj©rú1/tmp/pip-target-nv4zd3e_/lib/python/nacl/utils.pyÚ _from_partsszEncryptedMessage._from_partscCs|jS)zX The nonce used during the encryption of the :class:`EncryptedMessage`. )r©Úselfrrrr &szEncryptedMessage.noncecCs|jS)zP The ciphertext contained within the :class:`EncryptedMessage`. )r rrrrr -szEncryptedMessage.ciphertextN) Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú classmethodrÚpropertyr r rrrrrs  rc@seZdZdd„ZdS)Ú StringFixercCstjrt| ¡ƒS| ¡SdSr)ÚsixÚPY3ÚstrÚ __bytes__rrrrÚ__str__7s zStringFixer.__str__N)rrrrrrrrr5srcCstjr| d¡S|SdS)NÚascii)rrÚdecode)Zbytes_inrrrÚbytes_as_string>s r!é cCs t |¡Sr)ÚosÚurandom)ÚsizerrrÚrandomEsr&cCstj ||¡}| |¡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 )ÚnaclZbindingsZrandombytes_buf_deterministicÚencode)r%ÚseedÚencoderÚraw_datarrrÚrandombytes_deterministicIs r,)r")Ú __future__rrrr#rZ nacl.bindingsr'rÚbytesrÚobjectrr!r&Z RawEncoderr,rrrrÚs