https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/nacl/bindings/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/nacl/bindings/__pycache__/crypto_secretstream.cpython-310.pyc
o

��a�+�@s�UddlmZmZmZmZddlmZddlm	Z	m
Z
ddlmZe
�
�Zeed<e
��Zeed<e
��Zeed<e
��Zeed<e
��Zeed	<e
��Zeed
<e
��Zeed<e
��Zeed<e
��Z eed
<de!fdd�Z"Gdd�d�Z#de#de!de!fdd�Z$defde#de!dee!dede!f
dd�Z%de#de!de!ddfdd�Z&	d%de#d e!dee!dee!effd!d"�Z'de#ddfd#d$�Z(dS)&�)�
ByteString�Optional�Tuple�cast)�
exceptions)�ffi�lib)�ensure�,crypto_secretstream_xchacha20poly1305_ABYTES�1crypto_secretstream_xchacha20poly1305_HEADERBYTES�.crypto_secretstream_xchacha20poly1305_KEYBYTES�6crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX�0crypto_secretstream_xchacha20poly1305_STATEBYTES�1crypto_secretstream_xchacha20poly1305_TAG_MESSAGE�.crypto_secretstream_xchacha20poly1305_TAG_PUSH�/crypto_secretstream_xchacha20poly1305_TAG_REKEY�/crypto_secretstream_xchacha20poly1305_TAG_FINAL�returncCs(t�dt�}t�|�t�|�dd�S)zd
    Generate a key for use with
    :func:`.crypto_secretstream_xchacha20poly1305_init_push`.

    �unsigned char[]N)r�newrr�,crypto_secretstream_xchacha20poly1305_keygen�buffer)�keybuf�r�C/usr/lib/python3/dist-packages/nacl/bindings/crypto_secretstream.pyr4s�
rc@s"eZdZdZgd�Zddd�ZdS)�+crypto_secretstream_xchacha20poly1305_statezN
    An object wrapping the crypto_secretstream_xchacha20poly1305 state.

    )�statebuf�rawbuf�tagbufrNcCst�dt�|_d|_d|_dS)z Initialize a clean state object.rN)rrrrrr)�selfrrr�__init__Js�
z4crypto_secretstream_xchacha20poly1305_state.__init__)rN)�__name__�
__module__�__qualname__�__doc__�	__slots__r rrrrrBsr�state�keycCs�tt|t�dtjd�tt|t�dtjd�tt|�tkdtjd�t	�
dt�}t�
|j||�}t|dkdtjd�t	�|�dd�S)	a\
    Initialize a crypto_secretstream_xchacha20poly1305 encryption buffer.

    :param state: a secretstream state object
    :type state: crypto_secretstream_xchacha20poly1305_state
    :param key: must be
                :data:`.crypto_secretstream_xchacha20poly1305_KEYBYTES` long
    :type key: bytes
    :return: header
    :rtype: bytes

    �BState must be a crypto_secretstream_xchacha20poly1305_state object��raising�Key must be a bytes sequence�Invalid key lengthzunsigned char []r�Unexpected failureN)r	�
isinstancer�exc�	TypeError�bytes�lenr�
ValueErrorrrrr�/crypto_secretstream_xchacha20poly1305_init_pushr�RuntimeErrorr)r&r'�	headerbuf�rcrrrr4Us0��
���r4N�m�ad�tagc
Cs�tt|t�dtjd�tt|t�dtjd�tt|�tkdtjd�t|dup+t|t�dtjd�t|�t	}|j
dusCt|j
�|krJt�d|�|_
|durTtj
}d}nt|�}t�|j|j
tj
|t|�|||�}t|dkd	tjd�t�|j
|�dd�S)
a�
    Add an encrypted message to the secret stream.

    :param state: a secretstream state object
    :type state: crypto_secretstream_xchacha20poly1305_state
    :param m: the message to encrypt, the maximum length of an individual
              message is
              :data:`.crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX`.
    :type m: bytes
    :param ad: additional data to include in the authentication tag
    :type ad: bytes or None
    :param tag: the message tag, usually
                :data:`.crypto_secretstream_xchacha20poly1305_TAG_MESSAGE` or
                :data:`.crypto_secretstream_xchacha20poly1305_TAG_FINAL`.
    :type tag: int
    :return: ciphertext
    :rtype: bytes

    r(r)zMessage is not byteszMessage is too longN�%Additional data must be bytes or Nonerrr-)r	r.rr/r0r1r2r
r3r
rrr�NULLr�*crypto_secretstream_xchacha20poly1305_pushrr5r)r&r8r9r:�clen�adlenr7rrrr=�sF�
���
r=�headercCs�tt|t�dtjd�tt|t�dtjd�tt|�tkdtjd�tt|t�dtjd�tt|�t	kdtjd�|j
durDt�d�|_
t
�|j||�}t|d	kd
tjd�dS)a�
    Initialize a crypto_secretstream_xchacha20poly1305 decryption buffer.

    :param state: a secretstream state object
    :type state: crypto_secretstream_xchacha20poly1305_state
    :param header: must be
                :data:`.crypto_secretstream_xchacha20poly1305_HEADERBYTES` long
    :type header: bytes
    :param key: must be
                :data:`.crypto_secretstream_xchacha20poly1305_KEYBYTES` long
    :type key: bytes

    r(r)zHeader must be a bytes sequencezInvalid header lengthr+r,Nzunsigned char *rr-)r	r.rr/r0r1r2rr3rrrrr�/crypto_secretstream_xchacha20poly1305_init_pullrr5)r&r@r'r7rrrrA�s>��
��
�
�rA�cc
CsDtt|t�dtjd�t|jdudtjd�tt|t�dtjd�tt|�t	kdtjd�tt|�t
t	kdtjd�t|dupDt|t�dtjd�t|�t	}|jdus\t|j�|krct�
d	|�|_|durmtj}d
}nt|�}t�|j|jtj|j|t|�||�}t|d
kdtjd�t�|j|�dd�ttt|j�d
�fS)aM
    Read a decrypted message from the secret stream.

    :param state: a secretstream state object
    :type state: crypto_secretstream_xchacha20poly1305_state
    :param c: the ciphertext to decrypt, the maximum length of an individual
              ciphertext is
              :data:`.crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX` +
              :data:`.crypto_secretstream_xchacha20poly1305_ABYTES`.
    :type c: bytes
    :param ad: additional data to include in the authentication tag
    :type ad: bytes or None
    :return: (message, tag)
    :rtype: (bytes, int)

    r(r)NzOState must be initialized using crypto_secretstream_xchacha20poly1305_init_pullzCiphertext is not byteszCiphertext is too shortzCiphertext is too longr;rrr-)r	r.rr/r0rr3r1r2r
r
rrrr<r�*crypto_secretstream_xchacha20poly1305_pullrr5r�intr)r&rBr9�mlenr?r7rrrrC�sn���
����	��
�rCcCs&tt|t�dtjd�t�|j�dS)a�
    Explicitly change the encryption key in the stream.

    Normally the stream is re-keyed as needed or an explicit ``tag`` of
    :data:`.crypto_secretstream_xchacha20poly1305_TAG_REKEY` is added to a
    message to ensure forward secrecy, but this method can be used instead
    if the re-keying is controlled without adding the tag.

    :param state: a secretstream state object
    :type state: crypto_secretstream_xchacha20poly1305_state

    r(r)N)r	r.rr/r0r�+crypto_secretstream_xchacha20poly1305_rekeyr)r&rrrrFQs�rF)N))�typingrrrr�naclrr/�nacl._sodiumrr�nacl.exceptionsr	�,crypto_secretstream_xchacha20poly1305_abytesr
rD�__annotations__�1crypto_secretstream_xchacha20poly1305_headerbytesr�.crypto_secretstream_xchacha20poly1305_keybytesr�6crypto_secretstream_xchacha20poly1305_messagebytes_maxr
�0crypto_secretstream_xchacha20poly1305_statebytesr�1crypto_secretstream_xchacha20poly1305_tag_messager�.crypto_secretstream_xchacha20poly1305_tag_pushr�/crypto_secretstream_xchacha20poly1305_tag_rekeyr�/crypto_secretstream_xchacha20poly1305_tag_finalrr1rrr4r=rArCrFrrrr�<module>s�

�
�
�
�
�
�
�
�
���
�/�����
�C���
�8����

�X��

https://t.me/RX1948 - 2025