ok

Mini Shell

Direktori : /opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Hash/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Hash/__pycache__/SHA1.cpython-311.pyc

�

f��f"���ddlTddlmZmZmZmZmZmZmZedd��Z	Gd�de
��Zd
d�Zej
Z
ejZd	�ZdS)�)�*)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCrypto.Hash._SHA1a�
                        #define SHA1_DIGEST_SIZE 20

                        int SHA1_init(void **shaState);
                        int SHA1_destroy(void *shaState);
                        int SHA1_update(void *hs,
                                          const uint8_t *buf,
                                          size_t len);
                        int SHA1_digest(const void *shaState,
                                          uint8_t digest[SHA1_DIGEST_SIZE]);
                        int SHA1_copy(const void *src, void *dst);

                        int SHA1_pbkdf2_hmac_assist(const void *inner,
                                            const void *outer,
                                            const uint8_t first_digest[SHA1_DIGEST_SIZE],
                                            uint8_t final_digest[SHA1_DIGEST_SIZE],
                                            size_t iterations);
                        c�F�eZdZdZdZdZdZdd�Zd�Zd�Z	d	�Z
d
�Zdd�ZdS)
�SHA1Hasha�A SHA-1 hash object.
    Do not instantiate directly.
    Use the :func:`new` function.

    :ivar oid: ASN.1 Object ID
    :vartype oid: string

    :ivar block_size: the size in bytes of the internal message block,
                      input to the compression function
    :vartype block_size: integer

    :ivar digest_size: the size in bytes of the resulting hash
    :vartype digest_size: integer
    ��@z
1.3.14.3.2.26Nc�6�t��}t�|�����}|rt	d|z���t|���tj��|_|r|�	|��dSdS)N�!Error %d while instantiating SHA1)
r�
_raw_sha1_lib�	SHA1_init�
address_of�
ValueErrorr�get�SHA1_destroy�_state�update)�self�data�state�results    �r/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/SHA1.py�__init__zSHA1Hash.__init__Hs����
�
���(�(��)9�)9�);�);�<�<���	'��@�%�&�'�'�
'�"�5�9�9�;�;�#0�#=�?�?����	��K�K�������	�	�c	���t�|j���t	|��tt
|������}|rtd|z���dS)z�Continue hashing of a message by consuming the next chunk of data.

        Args:
            data (byte string/byte array/memoryview): The next chunk of the message being hashed.
        rN)r�SHA1_updaterrr
r	�lenr)rrrs   rrzSHA1Hash.updateSsv���*�*�4�;�?�?�+<�+<�+6�t�+<�+<�+3�C��I�I�+>�+>�@�@���	'��@�%�&�'�'�
'�	'�	'rc���t|j��}t�|j���|��}|rt
d|z���t|��S)z�Return the **binary** (non-printable) digest of the message that has been hashed so far.

        :return: The hash digest, computed over the data processed so far.
                 Binary form.
        :rtype: byte string
        r)r�digest_sizer�SHA1_digestrrrr)r�bfrrs   r�digestzSHA1Hash.digestaso��#�4�#3�4�4���*�*�4�;�?�?�+<�+<�+.�0�0���	'��@�%�&�'�'�
'��c�"�"�"rc�d�d�d�|���D����S)z�Return the **printable** digest of the message that has been hashed so far.

        :return: The hash digest, computed over the data processed so far.
                 Hexadecimal encoded.
        :rtype: string
        �c�2�g|]}dt|��z��S)z%02x)�bord)�.0�xs  r�
<listcomp>z&SHA1Hash.hexdigest.<locals>.<listcomp>zs#��@�@�@�Q���a���(�@�@�@r)�joinr')rs r�	hexdigestzSHA1Hash.hexdigestrs-���w�w�@�@�$�+�+�-�-�@�@�@�A�A�Arc���t��}t�|j���|j�����}|rtd|z���|S)a4Return a copy ("clone") of the hash object.

        The copy will have the same internal state as the original hash
        object.
        This can be used to efficiently compute the digests of strings that
        share a common initial substring.

        :return: A hash object of the same type
        zError %d while copying SHA1)rr�	SHA1_copyrrr)r�cloners   r�copyz
SHA1Hash.copy|sc���
�
���(�(�����):�):�).��)9�)9�);�);�=�=���	E��:�V�C�D�D�D��rc� �t|��S)z!Create a fresh SHA-1 hash object.)r)rrs  r�newzSHA1Hash.new�s����~�~�r�N)
�__name__�
__module__�__qualname__�__doc__r$�
block_size�oidrrr'r0r4r6�rrrr1s�������
�
� �K��J�
�C�	�	�	�	�'�'�'�#�#�#�"B�B�B����$�����rrNc�D�t���|��S)aCreate a new hash object.

    :parameter data:
        Optional. The very first chunk of the message to hash.
        It is equivalent to an early call to :meth:`SHA1Hash.update`.
    :type data: byte string/byte array/memoryview

    :Return: A :class:`SHA1Hash` hash object
    )rr6)rs rr6r6�s���:�:�>�>�$���rc	�f�t|��tksJ�|dksJ�tt��}t�|j���|j���||t|����}|rtd|z���t|��S)z/Compute the expensive inner loop in PBKDF-HMAC.rz(Error %d with PBKDF2-HMAC assis for SHA1)
r"r$rr�SHA1_pbkdf2_hmac_assistrrr	rr)�inner�outer�first_digest�
iterationsr&rs      r�_pbkdf2_hmac_assistrF�s����|����+�+�+�+���>�>�>�>�
�{�
+�
+�C�
�
2�
2��L�$�$�&�&��L�$�$�&�&� ���Z�(�(�*�*�F��N��C�f�L�M�M�M��#���rr7)�Crypto.Util.py3compat�Crypto.Util._raw_apirrrrrr	r
r�objectrr6r$r<rFr>rr�<module>rJs���*$�#�#�#�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�*�)�*=����
�(`�`�`�`�`�v�`�`�`�F
 �
 �
 �
 ��"���
 �
�����r

Zerion Mini Shell 1.0